My app needs to support two types of users:
regular
users , these are those who are subscribers (restaurants that use my app for managing their business). For these users, I have the out of box authentication (Laravel 5.1) set up.email
andpassword
are the fields I authenticate on. I maintain information about such users in myusers
table.guests
, these are people who visit the restaurants above, register to earn loyalty points, check their score, leave feedback, etc. I maintain information about such users in myguests
table. Authentication, in this case, is simple. I just use amobile_number
to authenticate them into the app.
I get that I can implement guest's authentication in a subdomain of my app, with different Controllers
and Views
.
What I don't get is, how can I use the eloquent
database driver with the two distinct models? I see that we specify the model eloquent would be using through config.auth.model
. So, I'm assuming that we can only have one single model implementing authentication.
Is, what I trying to achieve, possible without implementing a custom driver?