Composer require spatie laravel multitenancy. php: Complete ...
- Composer require spatie laravel multitenancy. php: Complete guide to building a SaaS with Laravel 12 and Filament 4. If we look at the config/multitenancy. Assuming that you have PHP and a web server installed, you can follow these steps to install Laravel:. The setup uses a shared database approach with tenant identification based on unique identifiers. Feb 10, 2026 · It works for multitenancy projects that need to use one or multiple databases. php, the database connection names are null for tenant and landlord. It also allows you to define what should happen when making a tenant the current one. Make your Laravel app usable by multiple tenants. Covers multi-tenancy, Stripe subscriptions, and deployment. Among these, the spatie/laravel-multitenancy package stands out for implementing multi-tenancy. The philosophy of this package is that it should only provide the bare essentials to enable multitenancy. laravel-multitenancy This package can be installed via composer: composer require spatie/laravel-multitenancy Publishing the config file You must publish the config file: php artisan vendor:publish --provider="Spatie\Multitenancy\MultitenancyServiceProvider" --tag="multitenancy-config" This is the default content of the config file that will be published at config/multitenancy. Before starting with the package, we highly recommend first watching this talk by Tom Schlick on multitenancy strategies. Oct 16, 2025 · This post assumes a single Laravel application with tenant awareness handled by spatie/laravel-multitenancy (database or single-db + tenant identifier), and the well-known spatie/laravel Apr 17, 2025 · This guide provides a step-by-step approach to setting up a multi-tenant SaaS application without subdomains using Laravel 12 and the Spatie Laravel Multitenancy package. This package simplifies the process of isolating tenant data, managing tenant-specific configurations, and handling tenant-aware routing. You will need two connections: landlord and tenant. php: <?php use This package can make a Laravel app tenant aware. Install the Laravel Framework To install the Laravel framework, you will need to have PHP and a web server installed on your system. config/multitenancy. First, we must configure the database connections. 0 Mar 23, 2025 · To implement multi-tenancy in Laravel using the Spatie package, start by installing the package via Composer. It works for multitenancy projects that need to use one or multiple databases. Set Up Your Laravel 12 Project Start by creating a new Laravel 12 project: composer create-project laravel/laravel:^12. Perfect for developers launchin Tagged with laravel, filament, saas, multitenancy. 1. 0 A tenant package (stancl/tenancy, spatie/laravel-multitenancy, or custom) License MIT Author Xyorqin The last package we will cover in the multi-tenancy single database comes from the well-known company Spatie. It has a name of spatie/laravel-multitenancy and has a slightly different philosophy than others. Run the command composer require spatie/laravel-multitenancy in your terminal. In addition, you will need to install composer, which is a dependency manager for PHP. The next step is choosing the multiple databases. 1 Laravel >= 10. This will slightly differ from the previous package in configuring database connections. Contribute to spatie/laravel-multitenancy development by creating an account on GitHub. No need to specify --tenant flag for each command Easy exit with exit command or Ctrl+X Supports multiple tenant packages Command history support (if readline is available) Requirements PHP >= 8. tpmmh, hhqpc, fgvmb6, nek2a, 7a0r, yxfrj, lrwzo, vmo4, zpafl, respw,