I\'m currently working on my first laravel project and i\'m facing a problem.
If you have experience with laravel you probably know that by calling php artisan
IN Custom Controller
public function login(Request $request){
if (Auth::attempt(['email' => $request->email,'password' => $request->password], false)){
return redirect()->intended(route('subportal.dashboard'));
}
return $this->sendFailedLoginResponse($request);
}
protected function validateLogin(Request $request)
{
$this->validate($request, [
$this->username() => 'required', 'password' => 'required',
]);
}
/**
* Get the login username to be used by the controller.
*
* @return string
*/
public function username()
{
return 'email';
}
In App/Users.php
public $table = "customer";
protected $primaryKey = 'cust_id';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'pass', 'email','record_date',
];
public function getAuthPassword() {
return $this->pass;
}