BasicAuthFilter.php 504 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php namespace App\Http\Filters;
  2. use Illuminate\Contracts\Auth\Authenticator;
  3. class BasicAuthFilter {
  4. /**
  5. * The authenticator implementation.
  6. *
  7. * @var Authenticator
  8. */
  9. protected $auth;
  10. /**
  11. * Create a new filter instance.
  12. *
  13. * @param Authenticator $auth
  14. * @return void
  15. */
  16. public function __construct(Authenticator $auth)
  17. {
  18. $this->auth = $auth;
  19. }
  20. /**
  21. * Run the request filter.
  22. *
  23. * @return mixed
  24. */
  25. public function filter()
  26. {
  27. return $this->auth->basic();
  28. }
  29. }