Palzin Track
Get 15% off with code PTRACKSIGNUP15 

Laravel Diary Logo

Laravel Collection Public API: first

The first method in Laravel's Collection class is used to retrieve the first item in a collection. You can also pass a callback function to specify criteria for selecting the first item. If there are no items that match the criteria, you can provide a default value to be returned.