Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

usama.ashraf's avatar

APP_URL Value During Queued Jobs

This has been bothering me for over a day now.

I've changed my APP_URL in the .env to APP_URL=http://localhost/fs4/public and app.php reads 'url' => env('APP_URL')

The environment is local and debug mode is on.

I'm sending emails while using the Redis queue driver and the emails include links rendered with route('some_route').

No matter what I do, the generated URL remains http://localhost/some_route rather than http://localhost/fs4/public/some_route.

I've cleared every cache I can think of.

Thanks.

0 likes
3 replies
bobbybouwmann's avatar

You url needs to match the url in your development environment. It looks like your test url is http://localhost and not the one you defined here.

Also the public part shouldn't be attached to the route at all.

usama.ashraf's avatar

I'm testing, yes. Here's an example of how I access my application. http://localhost/fs4/public/login

I have multiple applications on my WAMP.

BTW I don't get this problem when I'm sending mail synchronously. That's because the CLI has to be made explicitly aware of the base url.

Please or to participate in this conversation.