I'm learning Laravel auth now and I have small problem. I read some pages from Google about this mechanism and I'm using
Auth::attempt(['email'=>$request['email'],'password'=>$request['password']]);
Laravel gives me this error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'base.users' doesn't exist (SQL: select * from `users` where `email` = [email protected] limit 1)
In fact I don't have users
table in my database, I'm using name accounts
. How can I change default table in auth?
And additional question is: when I put data to Auth::attempt() data will changed to SQL query and all data will be get from base? How can I add more data than I get in base? For simple I have table ban
which this field have number of days when ban goes end. And I want to add field isbanned
which get TRUE/FALSE data. If ban
>0 will be TRUE, otherwise FALSE.
In config/auth.php
change 'table' => 'users'
to 'table' => 'accounts'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With