If you're following this guide: http://laravel.com/docs/5.1/authentication
You shouldn't make any query manually:
if (Auth::attempt(['email' => $email, 'password' => $password, 'active' => 1])) {
// The user is active, not suspended, and exists.
}
You can pass to attempt an array with all keys you want. The password value will be automatically hashed, you can add all fields you need to that array.
slillo said:
If you're following this guide: http://laravel.com/docs/5.1/authentication
You shouldn't make any query manually:
if (Auth::attempt(['email' => $email, 'password' => $password, 'active' => 1])) { // The user is active, not suspended, and exists. }
You can pass to attempt an array with all keys you want. The password value will be automatically hashed, you can add all fields you need to that array.
Worked perfectly, thank you so much sir.
Where exactly is that line? I can't seem to find it in my installation. I am using Laravel 5.2
Or should I create a new Controller, with only that function and then modify my routes to point to that controller ?
Anyone please help me out, I am also stuck to validate users while getting logged-in. I want to validate users having column 'active'. Users should not be get logged-in if they have 0 in active column means inactive state.
Thanks.
Finally I found the answer from a champion :-)
But what if i want to check i.e. status not equals to Deleted or Inactive ?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community