Laravel

Laravel Multiple Where Condition

Pinterest LinkedIn Tumblr
Example 1:

public function admin()
{
    $admin = Admin::select('name','id')
                ->where('id', $adminID)
                ->where('name', $name)
                ->get();
   
    dd($admin);
}
Example 2:

public function admin()
{
    $admin = Admin::select('*')
                ->where([
                    ['id', $adminID],
                    ['name', $name]
                ])
                ->get();
   
    dd($admin);
}

Write A Comment

Open chat
Hey Visitor,

How can I help you?