laravel orwhere

Posted by w3diy - 1 year ago

Laravel orWhere Condition using Eloquent Query

public function index()
{
    $users = DB::table('users')
                    ->where('id', 23)
                    ->orWhere('email', '[email protected]')
                    ->get();

    dd($users);                    
}

OR

public function index()
{
    $users = User::select("*")
                    ->where('id', 23)
                    ->orWhere('email', '[email protected]')
                    ->get();  

    dd($users);                    

}