PHPackages                             fshll/laravel-tenancy-whit-breeze-fortify-starter-kit - 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. [Framework](/categories/framework)
4. /
5. fshll/laravel-tenancy-whit-breeze-fortify-starter-kit

ActiveProject[Framework](/categories/framework)

fshll/laravel-tenancy-whit-breeze-fortify-starter-kit
=====================================================

The skeleton application for the Laravel framework.

07Blade

Since Jan 2Pushed 4mo agoCompare

[ Source](https://github.com/FSHLL/laravel-tenancy-whit-breeze-fortify-starter-kit)[ Packagist](https://packagist.org/packages/fshll/laravel-tenancy-whit-breeze-fortify-starter-kit)[ RSS](/packages/fshll-laravel-tenancy-whit-breeze-fortify-starter-kit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Laravel Multi-Tenancy Starter Kit
=================================

[](#laravel-multi-tenancy-starter-kit)

 [![Laravel Logo](https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg)](https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg)

[![Latest Stable Version](https://camo.githubusercontent.com/9e6071b5dd1a4a3bcabe3cca9d97a447d030caeb940f2adbd18699bc0b326702/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2f6672616d65776f726b)](https://packagist.org/packages/laravel/framework)[![Tenancy Version](https://camo.githubusercontent.com/4c339ff4217a17dda7dbd30e2ccd038d275fa74b041c5e9439f51675962116e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7374616e636c2f74656e616e6379)](https://packagist.org/packages/stancl/tenancy)[![Fortify Version](https://camo.githubusercontent.com/1c889f15c77904d891b786a220303fd650048fdc02c75042b866100c0535f6aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2f666f7274696679)](https://packagist.org/packages/laravel/fortify)[![Breeze Version](https://camo.githubusercontent.com/88ec4764ba1e75a13e426daafb778f3fecd66a8c3ad7f301befb48313d5bddcf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2f627265657a65)](https://packagist.org/packages/laravel/breeze)[![Laravel Permission Version](https://camo.githubusercontent.com/38d36ed7851d3308aece2dee9769f750900f2c7ef49defabdcf5f6adfe4b518d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d7065726d697373696f6e)](https://packagist.org/packages/spatie/laravel-permission)[![License](https://camo.githubusercontent.com/4a64c31c71966d152c876eea1f35e85fbd33d57ddf5754260a41f053aa72c5b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c61726176656c2f6672616d65776f726b)](https://packagist.org/packages/laravel/framework)

About This Project
------------------

[](#about-this-project)

This starter kit is a fully configured Laravel application that combines multi-tenancy best practices with robust and secure authentication. Perfect for SaaS applications that require:

- 🏢 **Complete multi-tenancy** with Laravel Tenancy
- 🔐 **Advanced authentication** with Laravel Fortify
- 🛡️ **Roles &amp; Permissions** with Spatie Laravel Permission
- 📱 **Two-factor authentication (2FA)**
- 🎨 **Modern UI** with Laravel Breeze and Tailwind CSS
- 🔧 **Development tools** with Laravel Telescope and Debugbar

Available Branches
------------------

[](#available-branches)

This repository contains multiple branches with different feature sets. Choose the branch that best fits your project needs:

### 🌿 [`main` (Base)](https://github.com/FSHLL/laravel-tenancy-whit-breeze-fortify-starter-kit)

[](#-main-base)

The base branch contains the core multi-tenancy setup with authentication:

- Laravel 12 with multi-tenancy (Stancl/Tenancy)
- Laravel Fortify authentication
- Two-factor authentication (2FA)
- Laravel Breeze UI
- Basic tenant isolation

### 🌿 [`feature/tenant-and-user-management`](https://github.com/FSHLL/laravel-tenancy-whit-breeze-fortify-starter-kit/tree/feature/tenant-and-user-management)

[](#-featuretenant-and-user-management)

Builds on `main` by adding comprehensive management interfaces:

- ✅ **Tenant Management**: Complete CRUD interface for managing tenants from central app
- ✅ **User Management**: Manage users across all tenants from central app
- ✅ **Domain Management**: Associate multiple domains with each tenant
- ✅ **Central User Command**: CLI tool to create central application users
- ✅ **Secure Operations**: Password confirmation for destructive actions
- ✅ **Tenant Isolation**: Automatic data scoping per tenant

**Use this branch if you need:** Admin interfaces to manage tenants and users centrally without role-based access control.

### 🌿 [`feature/tenant-user-management-and-permissions` (Recommended)](https://github.com/FSHLL/laravel-tenancy-whit-breeze-fortify-starter-kit/tree/feature/tenant-user-management-and-permissions)

[](#-featuretenant-user-management-and-permissions-recommended)

Builds on `feature/tenant-and-user-management` by adding a complete role and permission system:

- ✅ All features from `feature/tenant-and-user-management`
- ✅ **Spatie Laravel Permission**: Full RBAC implementation
- ✅ **Central Permissions**: Control tenant and user management operations
    - `CREATE_TENANT`, `VIEW_TENANT`, `UPDATE_TENANT`, `DELETE_TENANT`
    - `CREATE_TENANT_USER`, `VIEW_TENANT_USER`, `UPDATE_TENANT_USER`, `DELETE_TENANT_USER`
    - `CREATE_ROLE`, `VIEW_ROLE`, `UPDATE_ROLE`, `DELETE_ROLE`
- ✅ **Tenant-Scoped Permissions**: Per-tenant role and permission management
    - `VIEW_TENANT_USER_BY_TENANT`, `CREATE_TENANT_USER_BY_TENANT`, etc.
    - `VIEW_ROLE_BY_TENANT`, `CREATE_ROLE_BY_TENANT`, etc.
- ✅ **Role Management Interface**: CRUD operations for roles and permissions
- ✅ **Enum-Based Permissions**: Type-safe permission definitions
- ✅ **Middleware Protection**: Route-level permission enforcement
- ✅ **Automatic Seeding**: Permissions and roles auto-created per tenant
- ✅ **Super Admin Role**: Central role with all permissions

**Use this branch if you need:** Complete SaaS application with granular access control, multi-tenant role management, and secure permission-based operations.

### 📋 Branch Comparison

[](#-branch-comparison)

Featuremaintenant-and-user-managementtenant-user-management-and-permissionsMulti-Tenancy✅✅✅Authentication (Fortify)✅✅✅Two-Factor Auth (2FA)✅✅✅Tenant Management UI❌✅✅User Management UI❌✅✅Role Management UI❌❌✅Permission System❌❌✅Central Permissions❌❌✅Tenant-Scoped Permissions❌❌✅Middleware Protection❌❌✅CLI User Creation❌✅✅### 🔄 Switching Branches

[](#-switching-branches)

```
# Switch to tenant and user management
git checkout feature/tenant-and-user-management

# Switch to full permissions system (recommended)
git checkout feature/tenant-user-management-and-permissions

# Return to base
git checkout main
```

After switching branches, remember to:

```
composer install
npm install
php artisan migrate:fresh
php artisan db:seed --class=CentralPermissionsSeeder  # Only for permissions branch
```

Key Features
------------

[](#key-features)

### 🏗️ Multi-Tenant Architecture

[](#️-multi-tenant-architecture)

- Single database with tenant isolation using scopes
- Automatic identification by domain/subdomain
- Shared database with tenant-aware models
- Centralized tenant management
- Data isolation through global scopes and middleware

### 🔒 Authentication &amp; Security

[](#-authentication--security)

- **Laravel Fortify** for robust authentication
- **Two-factor authentication (2FA)** with QR codes
- Email verification
- Password recovery
- Brute force attack protection

### 🎨 User Interface

[](#-user-interface)

- **Laravel Breeze** for authentication views
- **Tailwind CSS** for modern styling
- Reusable components
- Responsive design

### 🛠️ Development Tools

[](#️-development-tools)

- **Laravel Telescope** for debugging and monitoring
- **Laravel Debugbar** for development
- **Laravel Pint** for code formatting
- Ready configuration for Laravel Sail

System Requirements
-------------------

[](#system-requirements)

- PHP 8.2 or higher
- Composer
- Node.js and NPM
- MySQL/PostgreSQL/SQLite
- PHP Extensions: BCMath, Ctype, Fileinfo, JSON, Mbstring, OpenSSL, PDO, Tokenizer, XML

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

[](#installation)

You have multiple options to install this starter kit:

### Option 1: Using Laravel Installer (Recommended) ⭐

[](#option-1-using-laravel-installer-recommended-)

```
# Install using Laravel installer with the branch you need
laravel new my-saas-app --using=FSHLL/laravel-tenancy-whit-breeze-fortify-starter-kit

# Or specify a specific branch
laravel new my-saas-app --using=FSHLL/laravel-tenancy-whit-breeze-fortify-starter-kit:feature/tenant-user-management-and-permissions
```

### Option 2: Using Composer Create-Project

[](#option-2-using-composer-create-project)

```
# Create project from main branch
composer create-project FSHLL/laravel-tenancy-whit-breeze-fortify-starter-kit my-saas-app

# Or from a specific branch
composer create-project FSHLL/laravel-tenancy-whit-breeze-fortify-starter-kit:dev-feature/tenant-user-management-and-permissions my-saas-app
```

### Option 3: Clone from GitHub

[](#option-3-clone-from-github)

```
# Clone the repository
git clone https://github.com/FSHLL/laravel-tenancy-whit-breeze-fortify-starter-kit.git my-saas-app
cd my-saas-app

# Switch to desired branch (optional)
git checkout feature/tenant-user-management-and-permissions

# Install dependencies
composer install
npm install
```

---

After installation using any of the options above, continue with the following steps:

### 1. Configure environment

[](#1-configure-environment)

```
cp .env.example .env
php artisan key:generate
```

### 4. Configure database

[](#4-configure-database)

Edit the `.env` file with your database credentials:

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=tenancy_app
DB_USERNAME=your_username
DB_PASSWORD=your_password
```

### 3. Run migrations

[](#3-run-migrations)

```
php artisan migrate
```

### 4. Seed permissions (only for permissions branch)

[](#4-seed-permissions-only-for-permissions-branch)

```
# Only if using feature/tenant-user-management-and-permissions branch
php artisan db:seed --class=CentralPermissionsSeeder

# Create your first super admin user
php artisan app:create-central-user
```

### 5. Compile assets

[](#5-compile-assets)

```
npm run dev
# or for production
npm run build
```

### 6. Start the server

[](#6-start-the-server)

```
php artisan serve
```

Your application will be available at `http://localhost:8000`

Multi-Tenancy Configuration
---------------------------

[](#multi-tenancy-configuration)

### Configure central domains

[](#configure-central-domains)

In `config/tenancy.php`, configure the domains that will host your central application:

```
'central_domains' => [
    '127.0.0.1',
    'localhost',
    'your-main-domain.com',
],
```

### Single Database Implementation

[](#single-database-implementation)

This starter kit uses a **single database** approach for multi-tenancy with the following features:

- All tenant data is stored in the same database
- Tables include a `tenant_id` column for data isolation
- Global scopes automatically filter data by tenant
- Middleware ensures proper tenant context
- Models are automatically scoped to the current tenant

### Route structure

[](#route-structure)

- **Central routes**: `routes/web.php`
- **Tenant routes**: `routes/tenant.php`
- **Shared routes**: `routes/shared.php`

2FA Configuration
-----------------

[](#2fa-configuration)

### Enable 2FA for a user

[](#enable-2fa-for-a-user)

1. User must have a verified email
2. Access the profile section
3. Enable two-factor authentication
4. Scan the QR code with an app like Google Authenticator
5. Confirm with a verification code

### Recovery codes

[](#recovery-codes)

- 8 recovery codes are automatically generated
- Each code can only be used once
- Can be regenerated at any time

Useful Commands
---------------

[](#useful-commands)

### Tenancy

[](#tenancy)

```
# Run command for all tenants (single database)
php artisan tenants:run "cache:clear"

# List all tenants
php artisan tenants:list
```

### Fortify

[](#fortify)

```
# Publish Fortify views
php artisan vendor:publish --tag=fortify-views

# Publish Fortify configuration
php artisan vendor:publish --tag=fortify-config
```

### Development

[](#development)

```
# Format code
vendor/bin/pint

# Clear cache
php artisan optimize:clear

# Run tests
php artisan test
```

Project Structure
-----------------

[](#project-structure)

```
├── app/
│   ├── Models/
│   │   ├── Tenant.php          # Tenant model
│   │   └── User.php            # User model with 2FA and tenant scopes
│   ├── Providers/
│   │   ├── FortifyServiceProvider.php
│   │   └── TenancyServiceProvider.php
│   ├── Scopes/                 # Global scopes for tenant isolation
│   └── Actions/Fortify/        # Custom Fortify actions
├── config/
│   ├── tenancy.php            # Tenancy configuration (single database)
│   └── fortify.php            # Fortify configuration
├── database/
│   └── migrations/            # Single database migrations with tenant_id columns
├── routes/
│   ├── web.php               # Central routes
│   ├── shared.php            # Shared routes between tenant and web centrar app
│   └── tenant.php            # Tenant-specific routes
└── resources/views/
    ├── auth/                 # Authentication views
    └── profile/              # Profile views with 2FA

```

Development and Contributing
----------------------------

[](#development-and-contributing)

### Development environment setup

[](#development-environment-setup)

```
# Using Laravel Sail
./vendor/bin/sail up -d
./vendor/bin/sail artisan migrate
./vendor/bin/sail npm run dev
```

### Code standards

[](#code-standards)

- PSR-12 for PHP
- Prettier for JavaScript/CSS
- Run `vendor/bin/pint` before commits

Additional Documentation
------------------------

[](#additional-documentation)

- [Laravel Tenancy Documentation](https://tenancyforlaravel.com/docs)
- [Laravel Fortify Documentation](https://laravel.com/docs/fortify)
- [Laravel Breeze Documentation](https://laravel.com/docs/starter-kits#laravel-breeze)
- [Laravel Documentation](https://laravel.com/docs)

License
-------

[](#license)

This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).

Support
-------

[](#support)

If you encounter any issues or have questions, please:

1. Check the documentation
2. Search existing issues
3. Create a new issue with problem details

Credits
-------

[](#credits)

- [Laravel Framework](https://laravel.com)
- [Laravel Tenancy](https://tenancyforlaravel.com)
- [Laravel Fortify](https://github.com/laravel/fortify)
- [Laravel Breeze](https://github.com/laravel/breeze)
- [Programming Fields - Laravel 11 Fortify Auth](https://www.youtube.com/watch?v=FpJkr5cS_7k&list=PLei32-mZRyeX1bQokcEOOvb1XE0VZbp6s)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance52

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e33f5a7d136015a0ca8f1647e038e37a85deb4d387b8c3c1467c80da4b9b2ba9?d=identicon)[FSHLL](/maintainers/FSHLL)

---

Top Contributors

[![FSHLL](https://avatars.githubusercontent.com/u/89928813?v=4)](https://github.com/FSHLL "FSHLL (5 commits)")

### Embed Badge

![Health badge](/badges/fshll-laravel-tenancy-whit-breeze-fortify-starter-kit/health.svg)

```
[![Health](https://phpackages.com/badges/fshll-laravel-tenancy-whit-breeze-fortify-starter-kit/health.svg)](https://phpackages.com/packages/fshll-laravel-tenancy-whit-breeze-fortify-starter-kit)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
