Authenticate.php 486 B

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