I have a Laravel 6 application.
In a typical application, the user would just specify their email, where the email is unique.
However, in my application, I have 2 columns in the User model that is used to authenticate users.
app_idemailunique(app_id, email)
So in order to login, we need to pass both an app_id and an email, along with the password. The same email could be used across different app_ids.
How would I achieve this?
The default login actions provided by
Auth::routes()are the following:This is the default
loginfunction, part of theAuthenticatesUserstrait used by theLoginController:There are a few ways to approach this.
Option 1: Override
loginfunction inLoginControllerOption 2: Override both the
validateLoginand thecredentialsfunctions inLoginController