2017 © Pedro Peláez
 

library multi-model-authentication

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

image

sebwas/multi-model-authentication

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

  • Saturday, November 7, 2015
  • by sebwas
  • Repository
  • 1 Watchers
  • 4 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

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., (*1)

Usage

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

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., (*3)

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., (*4)

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., (*5)

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., (*6)

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., (*7)

The Versions

07/11 2015

dev-dev

dev-dev

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

  Sources   Download

MIT

The Requires

 

laravel authentication model

07/11 2015

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

laravel authentication model