PHPackages                             imansugirman/backpack-multiauth - 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. imansugirman/backpack-multiauth

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

imansugirman/backpack-multiauth
===============================

This package enables using for laravel-backpack.

02PHP

Since May 30Pushed 6y agoCompare

[ Source](https://github.com/imansugirman/Backpack-Multi-Auth)[ Packagist](https://packagist.org/packages/imansugirman/backpack-multiauth)[ RSS](/packages/imansugirman-backpack-multiauth/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Abandoned
=========

[](#abandoned)

As backpack improved the way we can use auth guards, middlewares and so on, laravel-backpack-multiauth will not get any more updates.

Laravel-Backpack-Multiauth
==========================

[](#laravel-backpack-multiauth)

[![StyleCI](https://camo.githubusercontent.com/d1d3e0dee268de70f8d9f16507725235a487392f9a8bdbbcdb31abf3a635c71c/68747470733a2f2f7374796c6563692e696f2f7265706f732f39353936383931352f736869656c64)](https://styleci.io/repos/95968915)[![Build Status](https://camo.githubusercontent.com/e769be68fac3dcc2b5902f0bbc885148e5a7ac221d02c534b29a971661b23741/68747470733a2f2f7472617669732d63692e6f72672f7a6f7574617070732f6c61726176656c2d6261636b7061636b2d6d756c7469617574682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/zoutapps/laravel-backpack-multiauth)[![Latest Stable Version](https://camo.githubusercontent.com/d8452ceda041085e12f87a4b0f5de4aedd7900206717afafb6017c810df4f3d7/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7574617070732f6c61726176656c2d6261636b7061636b2d6d756c7469617574682f762f737461626c65)](https://packagist.org/packages/zoutapps/laravel-backpack-multiauth)[![Total Downloads](https://camo.githubusercontent.com/472ffa860923f5c4a564482580334b6fee07882acf4ef4ad3a1663cfd9ae2ca5/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7574617070732f6c61726176656c2d6261636b7061636b2d6d756c7469617574682f646f776e6c6f616473)](https://packagist.org/packages/zoutapps/laravel-backpack-multiauth)[![License](https://camo.githubusercontent.com/55bfb681ce88ceb8c70cf5a772a733a1cd5c2841728030505b28d1ee77a406f9/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7574617070732f6c61726176656c2d6261636b7061636b2d6d756c7469617574682f6c6963656e7365)](https://packagist.org/packages/zoutapps/laravel-backpack-multiauth)

Easy out of the box multiauth in Laravel and in [backpackforlaravel.com](http://backpackforlaravel.com).

And with [laravel-permisson](https://github.com/spatie/laravel-permission) you can also create pseudo user models to provide authentication vie roles.

- `php artisan zoutapps:multiauth` Generates a new auth guard and sets everything up.
- `php artisan zoutapps:roleauth` Generates a user subclass with role and sets up corresponding guards.
- `php artisan zoutapps:backpack:multiauth`Swaps the default backpack auth model and guard with a newly created.
- `php artisan zoutapps:backpack:roleauth` Swaps the default backpack auth model and guard with a newly created role based.

What it does?
-------------

[](#what-it-does)

With one simple command you can setup multi/role auth for your Laravel 5.4 project.
The package installs:

- Model
- Migration
- Controllers
- Notification
- Routes
    - routes/web.php
        - {guard}/login
        - {guard}/register
        - {guard}/logout
        - password reset routes
    - routes/{guard}.php
        - {guard}/home
- Middleware
- Views
- Guard
- Provider
- Password Broker
- Settings
- Scope

Usage
-----

[](#usage)

### Step 1: Install Through Composer

[](#step-1-install-through-composer)

As this package is currently only in beta and so there is no stable version you need to add `"zoutapps/laravel-backpack-multiauth": "dev-master"` to the `require-dev` section of your `composer.json` and perform `composer update`

### Step 2: Add the Service Provider

[](#step-2-add-the-service-provider)

You'll only want to use this package for local development, so you don't want to update the production `providers` array in `config/app.php`. Instead, add the provider in `app/Providers/AppServiceProvider.php`, like so:

```
public function register()
{
	if ($this->app->environment() == 'local') {
		$this->app->register(ZoutApps\LaravelBackpackAuth\AuthServiceProvider::class);
	}
}
```

### Step 3: Run the commands

[](#step-3-run-the-commands)

By running the commands you can setup multi/role auth for laravel or switch to an new model for laravel-backpack.

```
php artisan zoutapps:multiauth {singular_lowercase_name_of_guard}

// Examples
php artisan zoutapps:multiauth admin
php artisan zoutapps:multiauth employee
php artisan zoutapps:multiauth customer

```

```
php artisan zoutapps:roleauth {singular_lowercase_name_of_guard}

// Examples
php artisan zoutapps:roleauth admin
php artisan zoutapps:roleauth employee
php artisan zoutapps:roleauth customer

```

```
php artisan zoutapps:backpack:multiauth {singular_lowercasae_name_of_guard}

// Example
php artisan zoutapps:backpack:multiauth administrator

```

```
php artisan zoutapps:backpack:roleauth {singular_lowercasae_name_of_guard} {exact_role_name}

// Example
php artisan zoutapps:backpack:multiauth administrator

```

**Notice:**
You can provide the `-f` flag to force overwrite existing files. If you did not provide `-f` we will always ask you before overwriting.

**Alternatives:**If you want to install multiauth files in a subdomain you must pass the option `--domain`.

```
php artisan zoutapps:multiauth admin --domain
php artisan zoutapps:multiauth employee --domain
php artisan zoutapps:multiauth customer --domain

```

To be able to use this feature properly, you should add a key to your .env file:

```
APP_DOMAIN=yourdomain.com

```

This will allow us to use it in the routes file, prefixing it with the domain feature from Laravel routing system.
Using it like so: `['domain' => '{guard}.' . env('APP_DOMAIN')]`.

### Step 4: Migrate the model (not neccessary if roleauth)

[](#step-4-migrate-the-model-not-neccessary-if-roleauth)

```
php artisan migrate

```

### Step 5: Try it

[](#step-5-try-it)

Go to: `http://url_to_your_project/guard/login`
Example: `http://project/admin/login`

Options
-------

[](#options)

If you want to see which files are generated or touched provide the `-v` flag.

If you don't want model and migration use `--model` flag.

```
php artisan zoutapps:multiauth admin --model

```

If you don't want views use `--views` flag.

```
php artisan zoutapps:multiauth admin --views

```

If you don't want routes in your `routes/web.php` file, use `--routes` flag.

```
php artisan zoutapps:multiauth admin --routes

```

Note
----

[](#note)

If you want to adapt the redirect path once your `guard` is logged out, add and override the following method in your `{guard}Auth\LoginController`:

```
/**
 * Get the path that we should redirect once logged out.
 * Adaptable to user needs.
 *
 * @return string
 */
public function logoutToPath() {
    return '/';
}
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for mor information what was changed.

Credits
-------

[](#credits)

- [Zout Apps](http://zoutapps.de)
- [Oliver Ziegler](https://github.com/OliverZiegler)
- [All Contributors](../../contributors)

This package was influenced by several Tutorials and walkthroughs for Laravel MultiAuth, spatie/laravel-permission and several [Laracasts](https://laracasts.com).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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/b33a842bd580f7dd615324d607cc403b1f35a71b032a2e63fc0d075d12d01226?d=identicon)[imansugirman](/maintainers/imansugirman)

---

Top Contributors

[![imansugirman](https://avatars.githubusercontent.com/u/38036171?v=4)](https://github.com/imansugirman "imansugirman (1 commits)")

### Embed Badge

![Health badge](/badges/imansugirman-backpack-multiauth/health.svg)

```
[![Health](https://phpackages.com/badges/imansugirman-backpack-multiauth/health.svg)](https://phpackages.com/packages/imansugirman-backpack-multiauth)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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