更新时间:2023-11-17 17:51:22
将api防护作为参数传递,以获取授权用户,而无需中间件保护请求.
api
Pass the api guard as a parameter to fetch the authorized user without the middleware protecting the request.
$request->user('api'); // Or auth('api')->user();
Laravel 5.6-如何在api控制器中获取auth()-> user()或$ response-> user()?