I am adding 1 attribute for authentication, but it doesn't work. i'm not change anything except
adding this 2 method in my LoginController
protected function credentials(Request $request)
{
return $request->only($this->username(), 'password', 'division_id');
}
/**
* Attempt to log the user into the application.
*
* @param \Illuminate\Http\Request $request
* @return bool
*/
protected function attemptLogin(Request $request)
{
$request->merge(['division_id' => '1']);
return $this->guard()->attempt(
$this->credentials($request), $request->filled('remember')
);
}
I want to user login just exact division_id 1
import the request class with use \Illuminate\Http\Request;
at the top of the LoginController.
That should fix it ;)