laravel-multiple-domain-handling
laravel-multiple-domain-handling copied to clipboard
How to handle multiple subdomains in one Laravel application
Serving multiple apps with one Laravel codebase using subdomain routing
Demo on how to serve multiple applications with one Laravel codebase using subdomain routing.
Requirements
- Basic knowledge of the Laravel framework.
- Laravel CLI installed on your machine.
- Valet installed on your machine.
- A code editor like Visual Studio Code.
- SQLite installed on your machine.
⚠️ Valet is only officially available to Mac users. However, there are ports for both Linux and Windows available.
Getting Started
To get up and running, simply run the following commands, first clone the repository and run the following commands
$ composer install$ valet link acme$ valet link api.acme$ valet link admin.acme
Next, copy the .env.example file to .env and then add your database keys, and the APP_BASE_DOMAIN. Run the command below:
$ php artisan migrate --seed
And you are good to go.
Built with
- Laravel - PHP framework