I'm trying to figure out how Auth::attempt()
works. It doesn't return any error but it doesn't work either, just returns false.
I have tried to define the table name, I tried to add guards but I'm not sure how it works.
According to Laravel documentation, if I'm not mistaken, I should add a guard for each authentication (I need authentication with different tables).
That's how I defined a new guard: (I'm not sure if it has something to do with my issue)
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'web' => [
'driver' => 'session',
'provider' => 'guest',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
],
My question is how can I authenticate users retrieving data from the table I want using Auth::attempt()
or should I use my own method instead?
I'm new to Laravel so it's a little bit confusing.