I want to check an extra field that is stored in the users
table (for example approval
field) in the login process. In what way I can handle this, actually out of the vendor’s scope?
I want to check an extra field that is stored in the users
table (for example approval
field) in the login process. In what way I can handle this, actually out of the vendor’s scope?
2
Answers
There are many ways that you can solve this problem. Here I will talk about the simplest one:
Step 1: Create a Middleware
Step 2: Check your specific column
Step 3: Add your middleware to route (after login)
you can do that only by creating your custom LoginController and set backpack config to use your controller instead of the vendor’s one.
Custom Login Controller
now go to config/backpack/base.php and declare your custom login controller:
web.php