Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel where closure

$externalValue = "User";
$users = User::where(function ($query) use($externalValue) {
            return $query->where('type','Admin')->orWhere('type',$externalValue);
        })->where("role",1)->get();
 
PREVIOUS NEXT
Tagged: #laravel #closure
ADD COMMENT
Topic
Name
4+4 =