File tree 2 files changed +2
-1
lines changed
src/Illuminate/Container/Attributes 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,6 @@ public function __construct(public ?string $guard = null)
25
25
*/
26
26
public static function resolve (self $ attribute , Container $ container )
27
27
{
28
- return $ container ->make ('auth ' )->guard ( $ attribute ->guard )-> user ( );
28
+ return call_user_func ( $ container ->make ('auth ' )->userResolver (), $ attribute ->guard );
29
29
}
30
30
}
Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ public function testAuthedAttribute()
111
111
$ container = new Container ;
112
112
$ container ->singleton ('auth ' , function () {
113
113
$ manager = m::mock (AuthManager::class);
114
+ $ manager ->shouldReceive ('userResolver ' )->andReturn (fn ($ guard = null ) => $ manager ->guard ($ guard )->user ());
114
115
$ manager ->shouldReceive ('guard ' )->with ('foo ' )->andReturnUsing (function () {
115
116
$ guard = m::mock (GuardContract::class);
116
117
$ guard ->shouldReceive ('user ' )->andReturn (m:mock (AuthenticatableContract::class));
You can’t perform that action at this time.
0 commit comments