Last active
August 24, 2018 12:17
-
-
Save tisuchi/eb9cad7b6929cfda8712aa1d250fefca to your computer and use it in GitHub Desktop.
Laravel Call to undefined method App\Exceptions\Handler::unauthenticated()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Convert an authentication exception into an unauthenticated response. | |
| * | |
| * @param \Illuminate\Http\Request $request | |
| * @param \Illuminate\Auth\AuthenticationException $exception | |
| * @return \Illuminate\Http\Response | |
| */ | |
| protected function unauthenticated($request, AuthenticationException $exception) | |
| { | |
| if ($request->expectsJson()) { | |
| return response()->json(['error' => 'Unauthenticated.'], 401); | |
| } | |
| return redirect()->guest('login'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment