Filippo Bertilotti
2024-09-02 56f8c80f9a610c80810b24718340bc9cfd14df07
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
 
namespace App\Http\Middleware;
 
use Illuminate\Auth\Middleware\Authenticate as Middleware;
 
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|null
     */
    protected function redirectTo($request)
    {
        if (! $request->expectsJson()) {
            return response('Unauthorized.', 401);
        }
    }
}