PHPackages                             authority-php/authority-laravel - 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. authority-php/authority-laravel

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

authority-php/authority-laravel
===============================

A simple and flexible authorization system for PHP

2.4.5(9y ago)617.2k↓75%21MITPHPPHP &gt;=5.4.0

Since Apr 11Pushed 9y ago3 watchersCompare

[ Source](https://github.com/authority-php/authority-laravel)[ Packagist](https://packagist.org/packages/authority-php/authority-laravel)[ Docs](https://github.com/authority-php/authority-laravel)[ RSS](/packages/authority-php-authority-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (10)Used By (1)

Authority-Laravel
=================

[](#authority-laravel)

A simple and flexible authorization system for Laravel 5
--------------------------------------------------------

[](#a-simple-and-flexible-authorization-system-for-laravel-5)

### Installation via Composer

[](#installation-via-composer)

Add Authority to your composer.json file to require Authority

```
require : {
  "laravel/framework": "~5.0.16",
  "authority-php/authority-laravel": "dev-master"
}

```

Now update Composer

composer update

The last **required** step is to add the service provider to `config/app.php`

```
    'Authority\AuthorityLaravel\AuthorityLaravelServiceProvider',
```

Congratulations, you have successfully installed Authority. However, we have also included some other configuration options for your convenience.

For [**Laravel 4**](http://laravel.com/docs/4.2) supports, see [Authority-Laravel 2.3 branch](https://github.com/authority-php/authority-laravel/tree/2.3)

### Additional (optional) Configuration Options

[](#additional-optional-configuration-options)

##### Add the alias (facade) to your Laravel app config file.

[](#add-the-alias-facade-to-your-laravel-app-config-file)

```
    'Authority' => 'Authority\AuthorityLaravel\Facades\Authority',
```

This will allow you to access the Authority class through the static interface you are used to with Laravel components.

```
  Authority::can('update', 'SomeModel');
```

##### Publish the Authority default configuration file

[](#publish-the-authority-default-configuration-file)

```
  php artisan vendor:publish
```

This will place a copy of the configuration file at `config/authority.php`. The config file includes an 'initialize' function, which is a great place to setup your rules and aliases.

```
  // config/authority.php
