%PDF- %PDF-
Direktori : /var/www/html/klinisol/klinisol-api/app/Http/Middleware/ |
Current File : /var/www/html/klinisol/klinisol-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|void|null */ protected function redirectTo($request) { if (!$request->expectsJson()) { throw new UnauthorizedException(401, 'Unauthorized'); } } }