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);
}
Leave a Comment