How to make a laravel project multi-domain and remove a hidden dependency 'app.url' #37588
Replies: 1 comment
-
I gave it a second thought and I come to conclusion that there is a flaw in Laravel design. About
But in reality it has a list of use cases
It is particularly bad to have So ideally, there should be a way to keep this config value unset for testing Classes that supposed to work in a console environment to serve a multi domain projects. Just in case if such class would call something that relies on the domain. And if it does, there should be an exception thrown to let the developer know that there is a problem. Currently it hiding away problems providing "localhost" instead. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
I need to make my laravel project multi domain.
So now, domain should never be a hidden dependency for me.
How can I do that?
My idea was:
To make
$this->app['config']->get('app.url')
to not returning a value, but rather to throw an exception instead.Just to be sure that it was never used in email templates or middleware or other hidden places.
I don't know how to do it, though.
Maybe there should be a change in Laravel? For example we can remove default values from
Have anyone else had a similar task?
How should I clean up 'app.url' usage?
Beta Was this translation helpful? Give feedback.
All reactions