8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 46f68ab + 0f5de55 commit 5b14091Copy full SHA for 5b14091
laravel/auth/drivers/eloquent.php
@@ -7,14 +7,20 @@ class Eloquent extends Driver {
7
*
8
* If the user is a guest, null should be returned.
9
10
- * @param int $id
+ * @param int|object $token
11
* @return mixed|null
12
*/
13
- public function retrieve($id)
+ public function retrieve($token)
14
{
15
- if (filter_var($id, FILTER_VALIDATE_INT) !== false)
+ // We return an object here either if the passed token is an integer (ID)
16
+ // or if we are passed a model object of the correct type
17
+ if (filter_var($token, FILTER_VALIDATE_INT) !== false)
18
- return $this->model()->find($id);
19
+ return $this->model()->find($token);
20
+ }
21
+ else if (get_class($token) == Config::get('auth.model'))
22
+ {
23
+ return $token;
24
}
25
26
0 commit comments