Laravel Collection Public API: count
The count method in Laravel's Collection class returns the total number of items in the collection. It is a straightforward method that returns an integer. Use the count method to easily determine the size of a collection without the need for a loop.