2.2 documentation

Auth Component extends the functionality of Illuminate\Auth with the extra functionality to retrieve users' role. This is important when we want to use Orchestra\Acl to manage application Access Control List (ACL).

Table of Content

Version Compatibility

Laravel Auth
4.0.x 2.0.x
4.1.x 2.1.x
4.2.x 2.2.x

Installation

To install through composer, simply put the following in your composer.json file:

{
    "require": {
        "orchestra/auth": "2.2.*"
    }
}

And then run composer install from the terminal.

Quick Installation

Above installation can also be simplify by using the following command:

composer require "orchestra/auth=2.2.*"

Configuration

Next add the service provider in app/config/app.php.

'providers' => array(

    // ...
    # Remove 'Illuminate\Auth\AuthServiceProvider'
    # and add 'Orchestra\Auth\AuthServiceProvider'

    'Orchestra\Auth\AuthServiceProvider',
    'Orchestra\Memory\MemoryServiceProvider',

    'Orchestra\Auth\CommandServiceProvider',
),

Orchestra\Auth\AuthServiceProvider should replace Illuminate\Auth\AuthServiceProvider.

Aliases

To make development easier, you could add Orchestra\Support\Facades\Acl alias for easier reference:

'aliases' => array(

    'Orchestra\Acl' => 'Orchestra\Support\Facades\Acl',

),

Migrations

Before we can start using Auth Component, please run the following:

php artisan auth:migrate

The command utility is enabled via Orchestra\Auth\CommandServiceProvider.

Optionally you can enable Memory Component to use it with Orchestra\Acl, please run the following:

php artisan memory:migrate

The command utility is enabled via Orchestra\Memory\CommandServiceProvider.