Laravel: How to return an item in Eloquent, or throw a ModelNotFoundException exception if it isn't found?
firstOrFail(). This is similar to
findOrFail() does a 'WHERE id = ?' (assuming id is the primary key). With
firstOrFail() it will return the first row based on whatever WHERE statements you have.
If you don't
first() (which will return null if nothing is found.