Level 53
@minafaragamin if you only need to specify additional where or whereIn condition, you can override credential method in LoginController:
protected function credentials(Request $request)
{
return array_merge([
'is_admin' => true
], $request->only($this->username(), 'password'));
}
Otherwise, you would probably need to extend EloquentUserProvider and add the logic you want.
https://github.com/illuminate/auth/blob/master/EloquentUserProvider.php
3 likes