Instead of using url() in one case and configuration values ββin another, you can also use URL::forceRootUrl() only once, up, and then use url() everywhere.
For example, if you do this once at the beginning of the command code:
URL::forceRootUrl("http://example.whatever");
... then that url() will return from now on. In addition, other helpers, such as action() , etc., will use this as their base and return what you expect.
source share