Summer Sale! All accounts are 50% off this week.

overlocked's avatar

overlocked wrote a reply+100 XP

3d ago

Dynamic check or helper to get all enabled Fortify routes

That's a good idea, thanks! But the problem is that Fortify route names don't contain the fortify. prefix.

overlocked's avatar

overlocked started a new conversation+100 XP

3d ago

Dynamic check or helper to get all enabled Fortify routes

Currently, I am manually hardcoding paths to check if a URL belongs to active Fortify routes. For example, to avoid redirect loops with url.intended

if (url()->previous() != url('/register') && url()->previous() != url('/forgot-password')) {
    session(['url.intended' => url()->previous()]);
}

This approach is brittle. If I enable more Fortify features (like two-factor auth) in the future, I have to remember to manually update this list.I need a dynamic way to either check if a given URL/route belongs to Fortify, or programmatically retrieve a list of all currently enabled Fortify paths.

overlocked's avatar

overlocked liked a comment+100 XP

1w ago

schema:dump test sqlite

I'm facing the same issue, any solution after 7 months 😅

overlocked's avatar

overlocked liked a comment+100 XP

2mos ago

Laravel Vite: Assets blocked/Mixed Content issues in production environment

Just in case someone lands here for Laravel 11, where the TrustProxies.php file does not exist anymore, you can achieve @hermeneus proxy fix into bootstrap/app.php :

return Application::configure(basePath: dirname(__DIR__))
    // Your code…
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->trustProxies(headers: Request::HEADER_X_FORWARDED_FOR |
            Request::HEADER_X_FORWARDED_HOST |
            Request::HEADER_X_FORWARDED_PORT |
            Request::HEADER_X_FORWARDED_PROTO |
            Request::HEADER_X_FORWARDED_AWS_ELB
        );
        $middleware->trustProxies(at: '*');
       // Rest of your code… ```