Answers for "laravel where sometimes or empty"

PHP
7

laravel check if laravel query is empty

if ($result->first()) { } 
if (!$result->isEmpty()) { }
if ($result->count()) { }
if (count($result)) { }
Posted by: Guest on May-18-2020
1

laravel 8 check if null or empty

if(is_null($value) || empty($value)){dd('Is null or empty');}else{dd('Is NOT NULL OR EMPTY');}
Posted by: Guest on October-28-2021

Browse Popular Code Answers by Language