Answers for "check array is empty or not in laravel"

PHP
2

laravel check if array is empty

//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');}
Posted by: Guest on October-29-2020
0

laravel, if ->get() array is not emtpy

$threadID = Thread::where( "pillamail", $to )->get();

//sellega kontrollid, kas ->get tagastas midagi laravelis
					if ( $threadID->count() > 0 ) {
                    
                    }
  }
Posted by: Guest on August-16-2021

Code answers related to "check array is empty or not in laravel"

Browse Popular Code Answers by Language