Closed Nuranto closed 5 years ago
I am currently seeking a solution like that, due to an email I received recently. but this does not solve the issue.
that users
needs to be fetched dynamically for each auth()->check() call.
Well, it did solved my issue. Maybe we're not talking about the same thing ?
private function changeUsersDriver()
{
foreach(config('auth.providers', []) as $providerName => $providerConfig) {
$driver = $providerConfig['driver'];
if (in_array($driver, ['eloquent', 'database'])) {
config()->set("auth.providers.$providerName.driver", $driver.'MasterPassword');
}
}
}
this should do the job
Support for multiple guards is added in the v2.0.3
Suggestion :
and in config :
Of course, to be complete, it would be nice to add master password by provider (in case we have many auth guards), but that's kind of rare and it would be a lot of changes...