PHPackages                             sebwas/multi-model-authentication - 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. sebwas/multi-model-authentication

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

sebwas/multi-model-authentication
=================================

An alteration of the authentication methods by laravel to support multi model authentication

48PHP

Since Nov 7Pushed 10y ago1 watchersCompare

[ Source](https://github.com/sebwas/multi-model-authentication)[ Packagist](https://packagist.org/packages/sebwas/multi-model-authentication)[ RSS](/packages/sebwas-multi-model-authentication/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel MultiModelAuthentication
================================

[](#laravel-multimodelauthentication)

An approach to enable multi model authentication, which means that from a derived base class used for authentication there are certain decorating classes.

Usage
-----

[](#usage)

The usage is relatively easy and basically means to active the correct Service Provider and setup the *base model*.

### Activation

[](#activation)

In `config/app.php` setup up the `\SebWas\MultiModelAuthentication\AuthServiceProvider` instead of the default one, and also setup the right alias of `Auth => SebWas\MultiModelAuthentication\Facades\Auth::class`.

### Model

[](#model)

All models derived that should be user have to implement the `\SebWas\MultiModelAuthentication\ConsumingModel` interface to set everything up. You can also use the `\SebWas\MultiModelAuthentication\ConsumesModel` trait which gives you some handy functionality as well.

The model under `$this->app['config']['auth.model']` must implement the `\SebWas\MultiModelAuthentication\ProvidingModel` interface, which makes it obligatory to have the method `modelColumn()` defined which is supposed to tell the driver which column of the DB to use to get the right model.

Alternatively, the *base model* can implement the `\SebWas\MultiModelAuthentication\ProvidingModelAndAlias` interface which makes it, in addition to the first one, obligatory to implement a `modelAlias()` method which can then return an array with aliases that the value of `modelColumn()` should use to determine which Model to use.

As a third option you can use the `\SebWas\MultiModelAuthentication\SelfResolvingModel` interface, which then needs to implement a `resolveModel()` method that, itself, returns a valid fully qualified class name.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/690725?v=4)[Sebastian Wasser](/maintainers/sebwas)[@sebwas](https://github.com/sebwas)

---

Top Contributors

[![sebwas](https://avatars.githubusercontent.com/u/690725?v=4)](https://github.com/sebwas "sebwas (13 commits)")

### Embed Badge

![Health badge](/badges/sebwas-multi-model-authentication/health.svg)

```
[![Health](https://phpackages.com/badges/sebwas-multi-model-authentication/health.svg)](https://phpackages.com/packages/sebwas-multi-model-authentication)
```

###  Alternatives

[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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