hi @edres In a collection context $collection. When you create a collection of objects all the items are inserted in an specific order (usually order by id but you can change it).
If you use $collection->first() you would get the object on the first position of that collection. The same goes for last() but getting the last one.
When you make an Eloquent query you always get a collection of models (or only one if you use find()). Anyway You can end your statement with first() to get 1 object (that object would be the first of the query result, if you sort asc your query by id, it would be the one with the smaller id that comply with the where conditions, or if you sort desc it would be the one with the bigger id).
last() is not available as an Eloquent function but you can use first() and sort options to archive it.
For example, imagine that you have a User model with an age property:
$first_user_that_match = User::where('age', '>=', '18')->first();
With that query you are getting a collection of users with age >= 18 and staying with the first one in $first_user_that_match , doesn't matter which, the order result will determine what model would be.