Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AuthCheck
- {
- /**
- * Handle an incoming request.
- *
- * @param IlluminateHttpRequest $request
- * @param Closure $next
- * @return mixed
- */
- public function handle($request, Closure $next)
- {
- dd(auth('api')->user(), Auth::user(), $request->user('api'));
- if (!auth()->user())
- {
- return response()->json([
- 'error' => 'You must be logged in to access this.'
- ], 403);
- }
- return $next($request);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement