PHPackages                             kofoworola/laravel-subdomain - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kofoworola/laravel-subdomain

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kofoworola/laravel-subdomain
============================

v1.0(7y ago)1162[1 issues](https://github.com/kofoworola/laravel-subdomains/issues)GPL-3.0-onlyPHPPHP ^7.1.3

Since Oct 22Pushed 7y ago2 watchersCompare

[ Source](https://github.com/kofoworola/laravel-subdomains)[ Packagist](https://packagist.org/packages/kofoworola/laravel-subdomain)[ RSS](/packages/kofoworola-laravel-subdomain/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Associate models to dynamic subdomains in laravel
=================================================

[](#associate-models-to-dynamic-subdomains-in-laravel)

Easily setup dynamic subdomains registered to models on your application e.g `company1.myapp.com`

- [Intallation](#installation)
- [Config](#config)
- [Usage](#usage)
- [Facade](#facade)
- [Middleware](#middleware)

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

[](#-installation)

You can install this package via composer by

`composer require kofoworola/laravel-subdomain `

\*In Laravel 5.5 and below add this to your providers and aliases array

```
'providers'=>[
    //...
    kofoworola\Subdomains\ServiceProvider::class
]

```

```
'aliases' => [
    //..
    'Subdomains': kofoworola\Subdomains\Facade\Subdomains::class
]

```

Then run `php artisan vendor:publish` to publish the configuration file

 Config
-----------------------------------------

[](#-config)

The `config/subdomains.php` file:

```
