reed / auth
Multi-Auth for Laravel 5.1.
Requires
- php: >=5.6.4
- illuminate/auth: 5.1.*
- illuminate/container: 5.1.*
- illuminate/contracts: 5.1.*
- illuminate/cookie: 5.1.*
- illuminate/database: 5.1.*
- illuminate/http: 5.1.*
- illuminate/queue: 5.1.*
- illuminate/routing: 5.1.*
- illuminate/support: 5.1.*
- nesbot/carbon: ~1.20
Requires (Dev)
- mockery/mockery: ~0.9.4
- phpunit/phpunit: ~4.0
README
This is a mostly drop-in replacement for Laravel 5.2's Multi-Auth for Laravel 5.1. Most of the source core for this project comes from Laravel 5.2, and is just refactored to work with 5.1.
Deprecation Notice: With the final end of Laravel 5.1 being behind us, I am marking this package as abandoned. By now, everyone should be using Laravel 5.5 or greater. While I may still provide periodic updates, I am no longer officially maintaining this package.
Installation
Composer
Require this package with composer:
composer require reed/auth
Service Providers
After updating composer, add the Service Provider to the providers array in config/app.php
.
Reed\Auth\AuthServiceProvider::class
To avoid conflicts, you should also remove Laravel's Auth Provider.
// Illuminate\Auth\AuthServiceProvider::class,
However, you should keep Laravel's Auth Facade, as this package just replaces the underlying singleton.
Configuration
Go ahead and grab yourself a copy of Laravel 5.2's configuration file. The old configuration file won't work, and you'll probably want to configure this one to match your settings.
Replacement
Any references to Laravel 5.1's Authorization Layer isn't going to work anymore. You'll want to swap them out with the new components. Here are the new class paths:
Illuminate\Auth\*
=>Reed\Auth\*
Illuminate\Contracts\Auth\*
=>Reed\Auth\Contracts\*
Illuminate\Foundation\Auth\*
=>Reed\Auth\Foundation\*
Common places to find these are:
Authenticate
andRedirectIfAuthenticated
Middlewares- The
User
Model
Usage
It's exactly the same as Multi-Auth in Laravel 5.2, so I'll refer you to the documentation.