Logo

firstOrFail()

ops...
Thanks to: No one :(

Description

Will add LIMIT 1 to the query, and fail if no item is found, it throws an exception, unlike first().

Usage: $row = $this->Table->findById($rowId)->firstOrFail();