%PDF- %PDF-
Direktori : /var/www/html/hrsys/api/app/Http/Middleware/ |
Current File : /var/www/html/hrsys/api/app/Http/Middleware/Authenticate.php |
<?php namespace App\Http\Middleware; use Illuminate\Auth\Middleware\Authenticate as Middleware; use Spatie\Permission\Exceptions\UnauthorizedException; class Authenticate extends Middleware { /** * Get the path the user should be redirected to when they are not authenticated. * * @param \Illuminate\Http\Request $request * @return string */ protected function redirectTo($request) { if (!$request->expectsJson()) { throw new UnauthorizedException(401, trans('auth.unauthorized')); } } }