It may be possible, but you will have to try it. You can configure your own Auth driver, which simply extends the standard larvel auth driver, but modifies it a bit. You can do this through a provider, for example. In the provider download method, you say:
$this->app['auth']->extend('my-auth', function ($app) { return new Guard( new MyUserProvider($app['hash']), $app->make('session.store') ); });
Please note that we no longer pass the model through the constructor. We will handle it differently. Your class MyUserProvider extends EloquentUserProvider. We override the createModel method to our own version, which instead of using the constructed model name gets the model name at run time.
class MyUserProvider extends EloquentUserProvider { public function __construct(HasherContract $hasher) { $this->hasher = $hasher; } public function createModel() { $class = app()->config->get('auth.model'); return new $class; } }
I really have not tried to figure out if this works, but you can probably use this using this method.
source share