Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

limit query laravel

$role = $request->input('role');
 
$users = DB::table('users')
                ->when($role, function ($query, $role) {
                    $query->where('role_id', $role);
                })
                ->get();
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #limit #query #laravel
ADD COMMENT
Topic
Name
9+6 =