check if elquent retrun empty array laravel

check if elquent retrun empty array laravel

//for get() array methods
if($data_array->isEmpty())
{dd('EMPTY');}
else
{dd('NOT EMPTY');}

//for other array
if (count($data_array) > 0) 
{dd('EMPTY');}
else
{dd('NOT EMPTY');}

check if elquent retrun empty array laravel

$array->isEmpty()
// or
count($array)

1 thought on “check if elquent retrun empty array laravel”

  1. Good info and right to the point. I don’t know if this is really the best place to ask but do you folks have any ideea where to hire some professional writers? Thank you 🙂

    Reply

Leave a Comment