I\'m currently working on my Laravel app and to prevent spam I decided that only active users are able to login. I\'m currently using Laravel\'s login system just like in La
You don't have to override the whole function. You can just change the Validator in AuthController to achieve that adding "exists:table,column" validation.
Let's assume that you have a users table with email,password and active fields.
'email' => 'exists:users,email,active,1'
Here is the validotor function should look like in AuthController.php
protected function validator(array $data)
{
return Validator::make($data, [
'email' => 'required|email|max:255|exists:users,email,active,1',
'password' => 'required|confirmed'
]);
}
or if you are using soft deletes this should work too.
'email' => 'exists:users,email,deleted_at,NULL'
You can also check out the validation rule at this link http://laravel.com/docs/5.1/validation#rule-exists