How to check if array is empty in laravel

0 votes

I'm retrieving data using the get() method in a Laravel controller. If the result turns out to be empty, how can I verify this condition and proceed with the next step accordingly?

Here's the code snippet I'm currently working with:

​$bookingLists = Booking::where(['bookings.user_id' => $user_id,'bookings.status' => $bStatus ])->get(); if(empty($bookingLists)){ }else{ }
Apr 7, 2024 in Others by yogigurjar
• 100 points

edited 4 days ago 9 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP