PHPackages                             sunveloper/kbwebs-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. sunveloper/kbwebs-multiauth

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

sunveloper/kbwebs-multiauth
===========================

MultiAuth for Laravel 5.1

1.0.0(5y ago)026MITPHPPHP &gt;=5.5.9

Since Oct 9Pushed 5y ago1 watchersCompare

[ Source](https://github.com/sunveloper/kbwebs-multiauth)[ Packagist](https://packagist.org/packages/sunveloper/kbwebs-multiauth)[ RSS](/packages/sunveloper-kbwebs-multiauth/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

MultiAuth For Laravel 5.1
=========================

[](#multiauth-for-laravel-51)

---

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

[](#installation)

First, pull in the package through Composer.

```
"require": {
    "kbwebs/multiauth": "~1.0"
}
```

Now you'll want to update or install via composer.

```
composer update

```

Authentication
--------------

[](#authentication)

Open up the config/app.php file and replace the AuthServiceProvider with:

```
Illuminate\Auth\AuthServiceProvider::class -> Kbwebs\MultiAuth\AuthServiceProvider::class

```

And open config/auth.php file and remove:

```
'driver'  => 'eloquent'
'model'   => App\User::class,
'table'   => 'users'
```

and replace it with this array:

```
'multi-auth' => [
    'admin' => [
        'driver' => 'eloquent',
        'model'  => App\Admin::class
    ],
    'user' => [
        'driver' => 'eloquent',
        'model'  => App\User::class
    ]
]
```

If you want to use Database instead of Eloquent you can use it as:

```
'user' => [
    'driver' => 'database',
    'table'  => 'users'
]
```

Password Resets
---------------

[](#password-resets)

Open up config/app.php file and replace the PasswordResetServiceProvider with:

```
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class -> Kbwebs\MultiAuth\PasswordResets\PasswordResetServiceProvider::class

```

If you want to use the password resets from this Package you will need to change this in each Model there use password resets:

```
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
```

to

```
use Kbwebs\MultiAuth\PasswordResets\CanResetPassword;
use Kbwebs\MultiAuth\PasswordResets\Contracts\CanResetPassword as CanResetPasswordContract;
```

If you want to change the view for password reset for each auth type you can add this to the multi-auth array in config/auth.php:

```
'email' => 'emails.users.password'
```

If you dont add this line, Laravel will automatically use the default path for emails.password like its defined in the password array.

To generate the password resets table you will need to run the following command:

```
php artisan kbwebs:multi-auth:create-resets-table

```

Likewise, if you want to clear all password resets, you have to run the following command:

```
php artisan kbwebs:multi-auth:clear-resets

```

**NOTE** It is very important that you replace the default service providers. If you do not wish to use Password resets, then remove the original Password resets server provider as it will cause errors.

Usage
-----

[](#usage)

#### Authentication:

[](#authentication-1)

It works just like the original laravel authentication library, the only change is the **user()** or **admin()** it will match the auth type, as your defining in the multi-auth array:

```
Auth::attempt(['email' => $email, 'password' => $password], $remember)

```

But now it has to be like, with the **user()** or **admin()**:

```
Auth::user()->attempt(['email' => $email, 'password' => $password], $remember)

```

If you want to access the information for the authenticated user, you can do this:

```
Auth::user()->get();

```

OR

```
Auth::user()->get()->email

```

#### Password resets:

[](#password-resets-1)

It works just like the original laravel authentication library, the only change is the **user()** or **admin()** it will match the auth type, as your defining in the multi-auth array:

```
Password::sendResetLink($request->only('email'), function (Message $message) {
    $message->subject($this->getEmailSubject());
});

```

But now it has to be like, with the **user()** or **admin()**:

```
Password::user()->sendResetLink($request->only('email'), function (Message $message) {
    $message->subject($this->getEmailSubject());
});

```

Example for a password reset email:

```
Click here to reset your password: {{ URL::to('password/reset', array($type, $token)) }}.

```

This generates a URL like the following:

```
http://example.com/password/reset/user/21eb8ee5fe666r3b8d0521156bbf53266bnca572

```

Which will match the following route:

```
Route::get('password/reset/{type}/{token}', 'Controller@method');

```

#### Tip:

[](#tip)

Remember to update all places where ex: Auth:: is been using, to ex: Auth::user() or what you have defined in config/auth.php

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2039d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9681770f6a38904fed365d5465307bf69efe9c1fc4af1d12f0f6d3cf8e0bfcf8?d=identicon)[sunveloper](/maintainers/sunveloper)

---

Top Contributors

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

---

Tags

laravelauthuserloginmultisigninmultiauth

### Embed Badge

![Health badge](/badges/sunveloper-kbwebs-multiauth/health.svg)

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[sarav/laravel-multiauth

A Simple Laravel Package for handling multiple authentication

5030.7k](/packages/sarav-laravel-multiauth)[ollieread/multiauth

Alternative auth system for Laravel

443135.6k1](/packages/ollieread-multiauth)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[bmatovu/multi-auth

Laravel Multi Authentication

18325.1k](/packages/bmatovu-multi-auth)[mad-web/laravel-social-auth

Easy social auth integration with a lot of available providers

516.7k](/packages/mad-web-laravel-social-auth)

PHPackages © 2026

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