laravel-fortify-multitenancy maintained by isaacdew
Description
A package that makes it easy to setup subdomain-based multitenancy with Laravel Fortify.
Author
Last update
2022/05/02 05:05
(dev-main)
License
Downloads
6
Tags
laravel-fortify-multitenancy
Installation
composer require isaacdew/laravel-fortify-multitenancy
php artisan vendor:publish --tag=laravel-fortify-multitenancy-migrations
Add the SetTenant middleware to the top of the $middleware property in your Kernel.php:
namespace App\Http;
use Isaacdew\LaravelFortifyMultitenancy\SetTenant;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
SetTenant::class,
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
...