Logo

firstOrFail()

ops...

Description

Will add LIMIT 1 to the query. Unlike "first()", this will throw an exception if no record is found.

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