PATH:
home
/
rwabteecom
/
public_html
/
app
/
Http
/
Middleware
/
Editing: Authenticate.php
<?php namespace App\Http\Middleware; use Closure; use Illuminate\Auth\AuthenticationException; use Illuminate\Auth\Middleware\Authenticate as Middleware; use Illuminate\Http\Request; use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Auth; use Symfony\Component\HttpFoundation\Response; class Authenticate extends Middleware { /** * Handle an incoming request. * * @param string[] ...$guards * * @throws AuthenticationException * @throws AuthenticationException */ public function handle($request, Closure $next,...$guards) { $this->authenticate($request, $guards); App::setLocale(Auth::user()->language); return $next($request); } /** * Get the path the user should be redirected to when they are not authenticated. */ protected function redirectTo(Request $request): ?string { if (! $request->expectsJson()) { return route('login'); } } }
SAVE
CANCEL