laravel check if laravel query is empty
snippet in php

laravel check if laravel query is empty

user2896

if ($result->first()) { } 
if (!$result->isEmpty()) { }
if ($result->count()) { }
if (count($result)) { }