gecche / laravel-multidomain

A Laravel extension for using a laravel application on a multi domain setting
MIT License
843 stars 105 forks source link

How to call the domain() and domainList() method #48

Closed cavajr closed 3 years ago

cavajr commented 3 years ago

I am new to using this package, I would like to know how to call the domain() and domainList() method at run time.

gecche commented 3 years ago

Hi,

the package adds those methods to the app container, so a way (not the only) to use them is

app()->domain() which simply display the current domain and app()->domainsList() which lists all the domains registered in the config/domain.php file

Please note that there is an error in the doc which I will fix in the next release: the second method is called domainsList() and not domainList()

Cheers

Giacomo

P.S.: If you like the package and you haven't done yet, please leave a star :)