File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed
src/Illuminate/Container/Attributes Expand file tree Collapse file tree 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)
2525 */
2626 public static function resolve (self $ attribute , Container $ container )
2727 {
28- return $ container ->make ('auth ' )->guard ( $ attribute ->guard )-> user ( );
28+ return call_user_func ( $ container ->make ('auth ' )->userResolver (), $ attribute ->guard );
2929 }
3030}
Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ public function testAuthedAttribute()
111111 $ container = new Container ;
112112 $ container ->singleton ('auth ' , function () {
113113 $ manager = m::mock (AuthManager::class);
114+ $ manager ->shouldReceive ('userResolver ' )->andReturn (fn ($ guard = null ) => $ manager ->guard ($ guard )->user ());
114115 $ manager ->shouldReceive ('guard ' )->with ('foo ' )->andReturnUsing (function () {
115116 $ guard = m::mock (GuardContract::class);
116117 $ guard ->shouldReceive ('user ' )->andReturn (m:mock (AuthenticatableContract::class));
You can’t perform that action at this time.
0 commit comments