PHPackages                             appstract/laravel-multisite - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. appstract/laravel-multisite

ActiveLibrary[Framework](/categories/framework)

appstract/laravel-multisite
===========================

Multisite setup for Laravel

1.1.0(6y ago)21411.2k—0%28[1 issues](https://github.com/appstract/laravel-multisite/issues)MITPHPPHP &gt;=5.6

Since Mar 1Pushed 6y ago16 watchersCompare

[ Source](https://github.com/appstract/laravel-multisite)[ Packagist](https://packagist.org/packages/appstract/laravel-multisite)[ Docs](https://github.com/appstract/laravel-multisite)[ RSS](/packages/appstract-laravel-multisite/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (18)Used By (0)

Laravel Multisite
=================

[](#laravel-multisite)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e696109bd88e1149ee20952e395f77d05176e780e6f041aaf9256ff73f52428b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6170707374726163742f6c61726176656c2d6d756c7469736974652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/appstract/laravel-multisite)[![Total Downloads](https://camo.githubusercontent.com/03fb10f1344e3c8a826a0765dafa7acb090b49dd7fd5ed489dd8559c487a5e12/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6170707374726163742f6c61726176656c2d6d756c7469736974652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/appstract/laravel-multisite)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/0ad8cc5b7146bc1da8080090bea7c82b6aa6443019e681f6fd3a8cce2f9f159a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6170707374726163742f6c61726176656c2d6d756c7469736974652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/appstract/laravel-multisite)

With this package it is possible to build multiple sites/(sub)domains on one codebase.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require appstract/laravel-multisite
```

### Config (hosts, homestead)

[](#config-hosts-homestead)

You need to add the sites to your `/etc/hosts` file and `Homestead.yaml`. For example, `mywebsite.dev` and `blog.mywebsite.dev`. In the `Homestead.yaml`, you need to map the sites to the same folder.

### Publish

[](#publish)

By running `php artisan vendor:publish --provider="Appstract\Multisite\MultisiteServiceProvider"` in your project all files for multisite will be published. The files that will be published are: a migration, a seeder and a config file.

### Seeder

[](#seeder)

The seeder will be published but needs to be run when running `php artisan db:seed`, so you need the add `$this->call(SitesTableSeeder::class);` to your `DatabaseSeeder.php` file. After migrating and seeding the sites are now present in the database.

Usage
-----

[](#usage)

This is the main part, within your `routes/web.php` you can set routes for your sites within route groups, like this:

```
Route::group([
    'domain' => 'blog.'.config('multisite.host'),
    'as' => 'blog.',
    'middleware' => 'site:blog'
], function () {
    Route::get('/', 'BlogController@homepage')->name('homepage');
});
```

The magic happens with the site middleware `site:blog`. This will tell your app that the routes within the group are belonging to the blog. It will provide a variable called `$currentSite` in all your views. There is also a config available, which you can access with `Config::get('multisite.site')`.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Contributions are welcome, [thanks to y'all](https://github.com/appstract/laravel-multisite/graphs/contributors) :)

About Appstract
---------------

[](#about-appstract)

Appstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on [Medium](https://medium.com/appstract). You can [follow us on Twitter](https://twitter.com/teamappstract), [buy us a beer](https://www.paypal.me/teamappstract/10) or [support us on Patreon](https://www.patreon.com/appstract).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 53.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Recently: every ~172 days

Total

17

Last Release

2552d ago

Major Versions

0.5.3 → 1.0.02018-01-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1470623?v=4)[Gijs Jorissen](/maintainers/gizburdt)[@gizburdt](https://github.com/gizburdt)

![](https://avatars.githubusercontent.com/u/377001?v=4)[Ronald Krentz](/maintainers/Rokr)[@rokr](https://github.com/rokr)

![](https://avatars.githubusercontent.com/u/3015449?v=4)[Olav van Schie](/maintainers/ovanschie)[@ovanschie](https://github.com/ovanschie)

![](https://avatars.githubusercontent.com/u/17406280?v=4)[Teun de Kleijne](/maintainers/teuunn)[@teuunn](https://github.com/teuunn)

---

Top Contributors

[![gizburdt](https://avatars.githubusercontent.com/u/1470623?v=4)](https://github.com/gizburdt "gizburdt (8 commits)")[![ovanschie](https://avatars.githubusercontent.com/u/3015449?v=4)](https://github.com/ovanschie "ovanschie (3 commits)")[![zssarkany](https://avatars.githubusercontent.com/u/7733472?v=4)](https://github.com/zssarkany "zssarkany (2 commits)")[![303K](https://avatars.githubusercontent.com/u/3934941?v=4)](https://github.com/303K "303K (1 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (1 commits)")

---

Tags

laravelmiddlewaremultisitepackageappstractlaravel-multisite

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/appstract-laravel-multisite/health.svg)

```
[![Health](https://phpackages.com/badges/appstract-laravel-multisite/health.svg)](https://phpackages.com/packages/appstract-laravel-multisite)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
