Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

multi-auth

> 后端框架
Open source

Laravel Multi-Authentication Package

181 stars0 likes0 views
WebsiteGitHub

About

Laravel Multi-Authentication Package

Laravel Multi-Authentication Package

This package gives you the ability to separate user areas in your application.

E.g, an ecommerce application with customers, sellers, and administrators user areas using auth guards

Prerequisite

This package only extends the official laravel/breeze starter kit, it doesn't regenerate the frontend assets [js, css - tailwind, vite, ...]

Therefore, you need to use it after scaffolding basic auth using Breeze.

Breaking Changes

For old versions (Laravel v9 and below) refer to v11

Installation

bash
composer require bmatovu/multi-auth --dev

Scaffolding

bash
php artisan multi-auth:install admin

Register service provider

config/app.php

diff
  'providers' => [
      /*
      * Package Service Providers...
      */
+     App\Modules\Admins\AdminServiceProvider::class,
  ],

Register JS entry point in Vite (Inertia - Vue, React)

vite.config.js

diff
  export default defineConfig({
      plugins: [
          laravel({
-             input: 'resources/js/app.js',
+             input: [
+                 'resources/js/app.js',
+                 'resources/js/Admins/app.js',
+             ],
-             ssr: 'resources/js/ssr.js',
+             ssr: [
+                 'resources/js/ssr.js',
+                 'resources/js/Admins/ssr.js',
+             ],
              refresh: true,
          }),
          ...
      ],
  });

Read more about Inertia Server Side Rendering

Recompile frontend assets

bash
npm run build

Run Database Migrations

bash
php artisan migrate

Possible approaches for separating user areas

Using sub-domains

Separate user areas by sub-domains.

I would use separate repos for each sub-domain

URI User Group
larastore.com customers
seller.larastore.com sellers
admin.larastore.com administrators

Using URLs*

Separate user areas based on URLs. Restricted with auth guards

* What this package offers

URI User Group
larastore.com customers
larastore.com/seller sellers
larastore.com/admin administrators

Using roles

Restrict access based on the user's roles and permissions

I'd stay away from this approach as it'd more complex to maintain for large projects

URI User Group
larastore.com customers, sellers, administrators

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPauthenticationguardlaravellaravel-multi-authentication

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架