A bare bones front-end for knockout designed for maximum compatibility with "obsolete" browsers
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

45 Zeilen
911B

  1. <?php
  2. namespace App\Http\Middleware;
  3. use Closure;
  4. use Illuminate\Contracts\Auth\Factory as Auth;
  5. class Authenticate
  6. {
  7. /**
  8. * The authentication guard factory instance.
  9. *
  10. * @var \Illuminate\Contracts\Auth\Factory
  11. */
  12. protected $auth;
  13. /**
  14. * Create a new middleware instance.
  15. *
  16. * @param \Illuminate\Contracts\Auth\Factory $auth
  17. * @return void
  18. */
  19. public function __construct(Auth $auth)
  20. {
  21. $this->auth = $auth;
  22. }
  23. /**
  24. * Handle an incoming request.
  25. *
  26. * @param \Illuminate\Http\Request $request
  27. * @param \Closure $next
  28. * @param string|null $guard
  29. * @return mixed
  30. */
  31. public function handle($request, Closure $next, $guard = null)
  32. {
  33. if ($this->auth->guard($guard)->guest()) {
  34. return response('Unauthorized.', 401);
  35. }
  36. return $next($request);
  37. }
  38. }