Authenticate.php 417 B

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