Don’t do this mistake in the Laravel collection

Avoid using the empty function in the Laravel collection

Balaji Dharma
Dev Genius
Published in
4 min readNov 13, 2022

--

Photo by Mark Fletcher-Brown on Unsplash

The Laravel collection is a wrapper of a PHP array. In Laravel world, it was a new data type created based on the array. The Illuminate\Support\Collection class provides the Laravel collection. Also, the Laravel Eloquent methods will return the collection instance.

--

--