CoolFace
Apppublic

kenken999/php

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
Authenticate.php22 linesDownload Raw Back to Middleware
1<?php2 3namespace App\Http\Middleware;4 5use Illuminate\Auth\Middleware\Authenticate as Middleware;6 7class Authenticate extends Middleware8{9    /**10     * Get the path the user should be redirected to when they are not authenticated.11     *12     * @param  \Illuminate\Http\Request  $request13     * @return string|null14     */15    protected function redirectTo($request)16    {17        if (! $request->expectsJson()) {18            return route('login');19        }20    }21}22