Frage

I am trying to run my newsletter via queue in Laravel. So far, it's working, but I can't wrap my head around one problem.

This is running in CLI mode, so URL helpers like URL::route() and such are using url paramenter specified in environment app.php.

The problem is, this project has two URL adresses, one for each country, with different language, so when I would try to send the newsletter, one of the countries will have other country language, because there can be only one URL in app.php.

What I need is to have two URL adresses available at the time my queue is processing, or somehow switch them within job.

Does anybody have an idea how to solve this?

War es hilfreich?

Lösung

You cannot have more than one, but you can change the app.url in runtime by doing:

Config::set('app.url', 'http://example.com/en/');

App::setRequestForConsoleEnvironment();
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top