PHPackages                             chweb/multi-auth - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. chweb/multi-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

chweb/multi-auth
================

Laravel 12 Multi-Auth Package for PHP 8.4

v1.2.1-beta1(3mo ago)08MITPHPPHP ^8.4

Since Nov 26Pushed 3mo agoCompare

[ Source](https://github.com/chwebtechnologies/multi-auth)[ Packagist](https://packagist.org/packages/chweb/multi-auth)[ Docs](https://github.com/harshitchavda11/multi-auth)[ RSS](/packages/chweb-multi-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

Laravel Multi-Auth Package
==========================

[](#laravel-multi-auth-package)

[![Latest Version](https://camo.githubusercontent.com/82607e69abe99314712caaca3e9c3d804b6290df91f9771848c2c84b1d6bf4b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e312e302d626c75652e737667)](https://github.com/chweb/multi-auth)[![PHP Version](https://camo.githubusercontent.com/9709c53fa4d460e36586ea213ef599616646ff44e6805c5aa7cd9a4dc8f78271/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e342d707572706c652e737667)](https://php.net)[![Laravel Version](https://camo.githubusercontent.com/19411a8c92703d0173bff77f2f45daff06f9fa17eb500fdcd963414fadb3dbad/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d25354531312e3025323025374325323025354531322e302d7265642e737667)](https://laravel.com)

A modern, easy-to-use multi-authentication package for Laravel 12 with full Laravel Breeze integration. Supports Blade, React (Inertia), and Vue (Inertia) stacks.

✨ Features
----------

[](#-features)

- 🚀 **Quick Setup** - One command to scaffold complete authentication
- 🎨 **Multi-Stack Support** - Blade, React, and Vue with Inertia.js
- 🔍 **Auto-Detection** - Automatically detects and adapts to your stack
- 🔧 **Breeze Integration** - Seamlessly works with Laravel Breeze
- 📦 **Complete Scaffolding** - Models, migrations, controllers, routes, views, and config
- 🔐 **Password Reset** - Built-in secure password reset functionality
- 🎯 **Guard-Specific** - Separate authentication for different user types
- 🎛️ **Feature Toggling** - Enable/Disable Login, Registration, or Password Reset per guard
- 💎 **Modern UI** - Premium glassmorphism designs with Tailwind CSS
- 💡 **User-Friendly** - Interactive prompts and helpful messages

📋 Requirements
--------------

[](#-requirements)

- PHP ^8.4
- Laravel ^11.0 | ^12.0
- Composer

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require chweb/multi-auth:^1.0@beta
```

🚀 Quick Start
-------------

[](#-quick-start)

Create a new authentication guard (e.g., for admins):

```
php artisan multi-auth:install admin
```

That's it! The package will:

1. Check if Laravel Breeze is installed (and offer to install it if not)
2. Detect your current stack (Blade, React, or Vue)
3. Generate all necessary files for your new guard
4. Provide instructions for final configuration

📖 Usage
-------

[](#-usage)

### Basic Command

[](#basic-command)

```
php artisan multi-auth:install {guard-name}
```

### Examples

[](#examples)

Create an admin authentication:

```
php artisan multi-auth:install admin
```

Create a manager authentication:

```
php artisan multi-auth:install manager
```

Overwrite existing files:

```
php artisan multi-auth:install admin --force
```

🎯 What Gets Generated?
----------------------

[](#-what-gets-generated)

### For All Stacks

[](#for-all-stacks)

- **Model**: `app/Models/{Guard}.php`
- **Migration**: `database/migrations/{timestamp}_create_{guards}_table.php`
- **Controllers**:
    - `LoginController.php`
    - `DashboardController.php`
    - `PasswordResetLinkController.php`
    - `NewPasswordController.php`
- **Routes**: `routes/{guard}.php`
- **Config**: `config/multi-auth.php`

### Stack-Specific Files

[](#stack-specific-files)

**Blade Stack:**

- `resources/views/{guard}/login.blade.php`
- `resources/views/{guard}/forgot-password.blade.php`
- `resources/views/{guard}/reset-password.blade.php`
- `resources/views/{guard}/dashboard.blade.php`
- `resources/views/{guard}/layouts/app.blade.php`
- `resources/views/{guard}/layouts/navigation.blade.php`

**React Stack (Inertia):**

- `resources/js/Pages/{Guard}/Login.jsx`
- `resources/js/Pages/{Guard}/ForgotPassword.jsx`
- `resources/js/Pages/{Guard}/ResetPassword.jsx`
- `resources/js/Pages/{Guard}/Dashboard.jsx`

**Vue Stack (Inertia):**

- `resources/js/Pages/{Guard}/Login.vue`
- `resources/js/Pages/{Guard}/ForgotPassword.vue`
- `resources/js/Pages/{Guard}/ResetPassword.vue`
- `resources/js/Pages/{Guard}/Dashboard.vue`

⚙️ Configuration
----------------

[](#️-configuration)

### 1. Feature Toggling (`config/multi-auth.php`)

[](#1-feature-toggling-configmulti-authphp)

You can enable or disable specific features (Login, Password Reset, etc.) for each guard in `config/multi-auth.php`. This file is generated automatically.

```
'guards' => [
    'admin' => [
        'login' => true,
        'password_reset' => true,
        'register' => false, // Feature coming soon
    ],
],
```

### 2. Auth Configuration (`config/auth.php`)

[](#2-auth-configuration-configauthphp)

After running the install command, update your `config/auth.php`:

```
'guards' => [
    'admin' => [
        'driver' => 'session',
        'provider' => 'admins',
    ],
],

'providers' => [
    'admins' => [
        'driver' => 'eloquent',
        'model' => App\Models\Admin::class,
    ],
],

'passwords' => [
    'admins' => [
        'provider' => 'admins',
        'table' => 'password_reset_tokens',
        'expire' => 60,
        'throttle' => 60,
    ],
],
```

Register your routes in `bootstrap/app.php`:

```
->withRouting(
    web: __DIR__.'/../routes/web.php',
    commands: __DIR__.'/../routes/console.php',
    health: '/up',
    then: function () {
        Route::middleware('web')
            ->group(base_path('routes/admin.php'));
    },
)
```

> **Note:** If you are using Laravel 10 or older, register the route in `app/Providers/RouteServiceProvider.php`.

### ⚡ Frontend Setup

[](#-frontend-setup)

After installing the package, ensure you install dependencies and build assets:

```
npm install
npm run dev
```

Run the migration:

```
php artisan migrate
```

🛣️ Routes
---------

[](#️-routes)

For a guard named `admin`, the following routes are created:

MethodURINameDescriptionGET`/admin/login``admin.login`Show login formPOST`/admin/login``admin.login`Process loginPOST`/admin/logout``admin.logout`LogoutGET`/admin/forgot-password``admin.password.request`Show forgot password formPOST`/admin/forgot-password``admin.password.email`Send reset linkGET`/admin/reset-password/{token}``admin.password.reset`Show reset password formPOST`/admin/reset-password``admin.password.store`Reset passwordGET`/admin/dashboard``admin.dashboard`Dashboard (protected)🔐 Authentication
----------------

[](#-authentication)

The generated controllers use guard-specific authentication:

```
// Login
Auth::guard('admin')->attempt($credentials);

// Check authentication
Auth::guard('admin')->check();

// Get authenticated user
Auth::guard('admin')->user();

// Logout
Auth::guard('admin')->logout();
```

🎨 Breeze Integration
--------------------

[](#-breeze-integration)

### Automatic Detection

[](#automatic-detection)

The package automatically detects if Laravel Breeze is installed. If not, you'll be prompted to install it with your preferred stack.

### Stack Detection

[](#stack-detection)

The package detects your stack by checking `package.json`:

- **React**: Looks for `@inertiajs/react`
- **Vue**: Looks for `@inertiajs/vue3`
- **Blade**: Default if no Inertia dependencies found

### Manual Breeze Installation

[](#manual-breeze-installation)

If you prefer to install Breeze manually:

```
composer require laravel/breeze --dev
php artisan breeze:install blade  # or react, vue
```

Then run the multi-auth command:

```
php artisan multi-auth:install admin
```

📚 Documentation
---------------

[](#-documentation)

For detailed documentation, see:

- [Breeze Integration Guide](BREEZE_INTEGRATION.md)
- [Implementation Details](IMPLEMENTATION.md)

🔄 Version
---------

[](#-version)

Current version: **1.1.0**

Access programmatically:

```
use Chweb\MultiAuth\MultiAuthServiceProvider;

echo MultiAuthServiceProvider::VERSION; // 1.0.2
```

📝 Changelog
-----------

[](#-changelog)

See [CHANGELOG.md](CHANGELOG.md) for details on updates and changes.

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

👨‍💻 Author
----------

[](#‍-author)

**Harshit Chavda**

- Email:

🙏 Credits
---------

[](#-credits)

This package is inspired by the deprecated `hesto/multi-auth` package, rebuilt for modern Laravel with Breeze integration.

Disclaimer: This package is built on Laravel Breeze and inspired by the hesto/multi-auth concept. It is provided without any claim to original copyrights.

⚠️ Support
----------

[](#️-support)

For issues, questions, or feature requests, please open an issue on GitHub.

---

Made with ❤️ for the Laravel community

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance79

Regular maintenance activity

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Every ~15 days

Total

5

Last Release

113d ago

### Community

Maintainers

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

---

Tags

laravelAuthenticationmulti-auth

### Embed Badge

![Health badge](/badges/chweb-multi-auth/health.svg)

```
[![Health](https://phpackages.com/badges/chweb-multi-auth/health.svg)](https://phpackages.com/packages/chweb-multi-auth)
```

###  Alternatives

[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[andrewdwallo/filament-companies

A comprehensive Laravel authentication and authorization system designed for Filament, focusing on multi-tenant company management.

34450.0k2](/packages/andrewdwallo-filament-companies)[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)

PHPackages © 2026

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