2
votes

I have setup Laravel 5.5 and installed the default authentication scaffolding.

My application has two types of users - customers and staff - so I prefer to name the authentication guards that way, and the following configuration seems to work.

'guards' => [
    'web' => [
        'driver' => 'session',
        'provider' => 'users',
    ],
    'customers' => [
        'driver' => 'session',
        'provider' => 'customer-users',
    ],
    'staff' => [
        'driver' => 'session',
        'provider' => 'staff-users',
    ],
    'api' => [
        'driver' => 'token',
        'provider' => 'users',
    ],

My providers, customer-users and staff-users, use the standard eloquent driver, however they each return a different user type.

The problem is that I would like to remove the 'web' guard, since it's just cluttering the config file. When I do however, I get an exception somewhere deep in the Laravel middleware.

I can live with the extra clutter of course, but it does bother me that Laravel is relying on a configuration item that I can't change. Is this a Laravel bug, perhaps?

BTW - I don't have 'web' set as the default guard when I get the error...

1
i was wondering the same thing, i just overwrote the routes to the default auth to some other login page that i defined as defaultThiago

1 Answers

1
votes

By default web guard given by laravel which used for web authentication based on session driver with the table users. Now you have created your own custom guards and you are using it. So your wish to keep that web guard. But if you remove, you might be facing some internal issue, so best you keep it and it's not going to be the performance issue too.