Authenticate.php 476 B

12345678910111213141516171819202122
  1. <?php
  2. namespace App\Http\Middleware;
  3. use Closure;
  4. use Illuminate\Auth\Middleware\Authenticate as Middleware;
  5. class Authenticate extends Middleware
  6. {
  7. /**
  8. * Get the path the user should be redirected to when they are not authenticated.
  9. *
  10. * @param \Illuminate\Http\Request $request
  11. * @return string
  12. */
  13. protected function redirectTo($request)
  14. {
  15. if ( $request->expectsJson()) {
  16. return route('login');
  17. }
  18. }
  19. }