Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Laravel websites, central codebase

Tags:

php

laravel

I want to create a single Laravel installation that comprises the core functionality of the websites - for example content CRUD functions.

Then on top of this in separate folder on the server for each website have the public folder, css, images etc as well as overriding controllers, models and routes that can be used for specific features per site.

I have achieved the same previously using FuelPHP but have not been able to see where this would be setup in Laravel.

The kind of server folder structure I was anticipating is as below:

/Laravel Core Installation

  • /app
  • /vendor
  • storage
  • etc

/The first website

  • public
  • app (in here would be controllers and models that extend the controllers and models from the Laravel Core Installation folder)
  • config
  • etc

/The second website

  • public
  • app (in here would be controllers and models that extend the controllers and models from the Laravel Core Installation folder)
  • config
  • etc
like image 867
Reactive Avatar asked Apr 10 '26 07:04

Reactive


1 Answers

What you are referring to is called multi tenancy.

Multitenancy refers to a software architecture in which a single instance of a software runs on a server and serves multiple tenants.

http://en.wikipedia.org/wiki/Multitenancy

There are several packages that assist with multi tenancy for Laravel, based on your needs. Some work with seperate database table prefixing, others with completely seperated databases and files.

Some of those packages:

  • Tenanti
  • AuraEQ
  • Hyn *

* Disclaimer; I wrote the last package from this list.

like image 75
Luceos Avatar answered Apr 12 '26 20:04

Luceos