PHP code example of dersam / laravel-multitenant
1. Go to this page and download the library: Download dersam/laravel-multitenant library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dersam / laravel-multitenant example snippets
artisan migrate
artisan vendor:publish --provider="Dersam\Multitenant\ServiceProvider"
$php
$tenant = Tenant::find($user->tenant_id);
if ($tenant === null) {
return redirect('/');
}
$this->tenantSwitcher->switchGlobalTenant($tenant);