I am accessing my database using model by using following code.
$persons = WysPerson::where('family_id', $id)->get();
I checked $persons
is empty or not by using following code.
if($persons){
var_dump($persons);
}
Actually $persons
is empty. But I am getting result for var_dump
as
object(Illuminate\Database\Eloquent\Collection)#417 (1) { ["items":protected]=> array(0) { } }
How will I check $persons
is empty? Can anyone help?