Support the ongoing development of Laravel.io →
Blade Database Eloquent
Last updated by @yogigurjar 7 months ago.
0

if(!$bookingLists->count()) { } else { }

joshpennington liked this reply

1

if($bookingLists->isEmpty()) {} else {}

Last updated by @dancoulter 7 months ago.
0

First thing to understand is that it is not an array but a Collection. As collection there are different ways to process it further > https://laravel.com/docs/11.x/collections - check if empty, filter, map, loop and etc..

Last updated by @sv3tli0 6 months ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.