0

I have a problem that I'm facing with Laravel 6 LTS version. I have 3 different controllers: AdminController (/admin), ScheduleController (/schedule) and ClientController (/client). Each of those controller should authenticate different database table of users. For /admin it uses 'users' table, for /schedule it uses 'companies' table and for /client it uses 'clients' table. Technically, you should be able to login to each "controller" without the worry of colliding with other controllers. For instance, you can be logged in to /admin and also to /client and /schedule (separate login form for each). How should I go about this? Can someone point me in the right direction? Is this possible with Laravel?

Thanks

1

1 Answer 1

1

You can set different user providers in config/auth.php

'providers' => [ 'user' => [ 'driver' => 'eloquent', 'model' => App\User::class, ], 'admin' => [ 'driver' => 'eloquent', 'model' => App\Admin::class, ], ], 

Reference

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.