
* update composer.lock * run pint * fix phpstan * update migrations (sqlite `dropForeign`) * fix migrations * Reset these back for now * Alphabetize the rules * run `php artisan filament:upgrade` --------- Co-authored-by: Lance Pioch <git@lance.sh>
27 lines
568 B
PHP
27 lines
568 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Auth\AuthManager;
|
|
|
|
class RedirectIfAuthenticated
|
|
{
|
|
/**
|
|
* RedirectIfAuthenticated constructor.
|
|
*/
|
|
public function __construct(private AuthManager $authManager) {}
|
|
|
|
/**
|
|
* Handle an incoming request.
|
|
*/
|
|
public function handle(Request $request, \Closure $next, ?string $guard = null): mixed
|
|
{
|
|
if ($this->authManager->guard($guard)->check()) {
|
|
return redirect()->route('index');
|
|
}
|
|
|
|
return $next($request);
|
|
}
|
|
}
|