문제

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?

도움이 되었습니까?

해결책

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();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top