Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can you use this for multi auth? having multiple user tables? #287

Open
codeitlikemiley opened this issue Jun 22, 2017 · 7 comments
Open

Comments

@codeitlikemiley
Copy link

dont know if this can be use for multiple users

lets say i have a user model, employee model, and client model...

is this hard coded to be use only for a user model or this is using polymorphism

for the person who revision it? where you can associate different model to it?

@codeitlikemiley
Copy link
Author

after digging some code i found out that

userResponsbile method has this...

 $user_model = \Config::get('auth.providers.users.model');

so it really wont work out of the box since

you are getting only the users providers,

if i do multi auth i will havemultiple providers so this wont work

'providers' => [
        
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],

        'employees' => [
            'driver' => 'eloquent',
            'table' =>App\Employee::class,
        ],

        'clients' => [
            'driver' => 'eloquent',
            'table' =>App\Client::class,
        ],
    ],

Any Work Around On This?

@aauerswald
Copy link

aauerswald commented Aug 31, 2017

Any solution for this or workaround without changing the code?

'providers' => [

    'users' => [
        'driver' => 'eloquent',
        'model' => App\Models\Frontend\User::class,
    ],

    'admins' => [
        'driver' => 'eloquent',
        'model' => App\Models\Backend\Admin::class,
    ],

],

@EmanueleCoppola
Copy link

Any news on this?

@neoacevedo
Copy link

mmmm I am just in the same situation and I see no one knows the workaround :/

@EmanueleCoppola
Copy link

@neoacevedo I actually made a fork of this. Just a workaround, a little bit dirty but that works. You can take inspiration if you want to.

https://github.com/Libreidee/revisionable-multiauth

@neoacevedo
Copy link

@EmanueleCoppola I will check for it.

@koushik355
Copy link

Any update here? Same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants