Danial Butt
Danial Butt

Reputation: 51

Run two websites with one laravel installation

How we can use multiple applications with one Laravel installation.

For example: www.apple.com www.orange.com

both website will use ONE CORE laravel installation with separate database and all other separate stuff.

Is that possible? If yes then how?

Also I have done the same thing for CodeIgniter but not sure how i can do with laravel.

Upvotes: 0

Views: 298

Answers (2)

leyduana
leyduana

Reputation: 159

You can use this package https://github.com/nWidart/laravel-modules to better organize your code into it's separate websites within the same laravel base code. E.g. you can have Website1 and Website2 modules that has their own Controllers, Models, Views, database migrations, etc.

Upvotes: 0

Lourenci
Lourenci

Reputation: 123

You can use route group for this, it's something like this:

Route::group(['domain' => 'myapp.com'], function () {
    Route::get('user/{id}', 'Controller@Method');
});

Official documentation: Sub-domain routing

Upvotes: 1

Related Questions