Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 6bb06cd

Browse files
committed
Allow setting the fallback user provider.
1 parent 8503332 commit 6bb06cd

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/Auth/DatabaseUserProvider.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ public function __construct(Hasher $hasher, $model)
4949
{
5050
$this->model = $model;
5151
$this->hasher = $hasher;
52-
$this->fallback = new EloquentUserProvider($hasher, $model);
52+
53+
$this->setFallback(
54+
new EloquentUserProvider($hasher, $model)
55+
);
5356
}
5457

5558
/**
@@ -156,6 +159,18 @@ public function validateCredentials(Authenticatable $model, array $credentials)
156159
return false;
157160
}
158161

162+
/**
163+
* Set the fallback user provider.
164+
*
165+
* @param UserProvider $provider
166+
*
167+
* @return void
168+
*/
169+
public function setFallback(UserProvider $provider)
170+
{
171+
$this->setFallback($provider);
172+
}
173+
159174
/**
160175
* Create a new instance of the model.
161176
*

0 commit comments

Comments
 (0)