tenancy-docs/source/docs/v3/installation.blade.md
Adebayo Ilerioluwa a4645b3abd
Improved Documentation Search (#61)
* chore: (Improve documentation search for V3)

* fix: checks for mispelled words

* fix: mispelled words

* fix spaces and syntax

* Update multi-database-tenancy.blade.md

Co-authored-by: Samuel Stancl <samuel.stancl@gmail.com>
2020-07-21 20:18:29 +02:00

42 lines
No EOL
1 KiB
Markdown

---
title: Installation
extends: _layouts.documentation
section: content
---
# Installation {#installation}
Require the package using composer:
```php
composer require stancl/tenancy
```
Then run the following command:
```php
php artisan tenancy:install
```
It will create:
- migrations
- a config file (`config/tenancy.php`),
- a routes file (`routes/tenant.php`),
- and a service provider file `app/Providers/TenancyServiceProvider.php`
Then add the service provider to your `config/app.php` file:
```php
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\TenancyServiceProvider::class, // <-- here
```
And finally, name your central connection (in `config/database.php`) `central` — or however else you want, but make sure it's the same name as the `tenancy.central_connection` config.