Laravel Multidomain Package

Laravel Multidomain Package

Laravel Multidomain is a package by @gecche that allows a single Laravel Installation to work with multiple HTTP domains:

There are many cases in which different customers use the same application in terms of code but not in terms of database, storage, and configuration.

This package gives a very simple way to get a specific env file, a specific storage path, and a specific database for each such customer.

Once you finish the installation and setup outlined in the readme, you can use package commands to manage domains:

# Adding a domain
php artisan domain:add 
php artisan domain:add 

# Removing a domain
php artisan domain:remove 

When you add a domain, the .env configuration file is created for that specific domain:

php artisan domain:add 
# Generates the following configuration file

You can also list domains with the domain:list command:

php artisan domain:list

Be sure to check out the full documentation of the package before deciding to use this package. This package provides an extended kernel and requires some buy-in in the methodology of this approach. Just make sure you evaluate the design of this package (and any package for that matter) for your use-case.

You can learn more about this package, get full installation instructions, and view the source code on GitHub at gecche/laravel-multidomain.

This package was submitted to our Laravel News Links section. Links is a place the community can post packages and tutorials around the Laravel ecosystem. Follow along on Twitter @LaravelLinks

Filed in: News


Join 31,000+ others and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Senior Full-Stack Engineer
[REMOTE: USA Only] All Other Applications Will be Rejected Immediately"
Senior Full Stack PHP Developer
Motto Design Studio
👉 Looking for Senior Back-End Laravel API Developer - Immediate (Full-time Contractor) 🎉
Remote // The Document Signing Experience™
Senior Full-Stack Developer
Remote, USA Only
Senior Full Stack Engineer
Remote / Los Angeles, USA
Entertainment Media