Authenticate.php 419 B

1234567891011121314151617
  1. <?php
  2. namespace App\Http\Middleware;
  3. use Illuminate\Auth\Middleware\Authenticate as Middleware;
  4. use Illuminate\Http\Exceptions\HttpResponseException;
  5. class Authenticate extends Middleware
  6. {
  7. protected function unauthenticated($request, array $guards)
  8. {
  9. throw new HttpResponseException(response()->json([
  10. 'status' => false,
  11. 'message' => 'Unauthorized'
  12. ], 403));
  13. }
  14. }