PHPackages                             darrylkuhn/enforce - 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. darrylkuhn/enforce

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

darrylkuhn/enforce
==================

Enforce access control restrictions using Eloquent models

1.1(11y ago)5189MITPHPPHP &gt;=5.4.0

Since Jun 12Pushed 11y ago1 watchersCompare

[ Source](https://github.com/darrylkuhn/enforce)[ Packagist](https://packagist.org/packages/darrylkuhn/enforce)[ RSS](/packages/darrylkuhn-enforce/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Enforce
=======

[](#enforce)

Enforce is an add on for **Laravel4** and provides an elegant way to define custom data access enforcers on your Eloquent ORM models.

Quick start
-----------

[](#quick-start)

In the `require` key of `composer.json` file add the following

```
"darrylkuhn/enforce": "dev-master"

```

Run the Composer update comand

```
$ composer update

```

In `config/app.php` in the $aliases array replace the existing 'Eloquent' key with 'Enforce\\Model':

```
'aliases' => array(

    'App'        => 'Illuminate\Support\Facades\App',
    'Artisan'    => 'Illuminate\Support\Facades\Artisan',
    ...
    'Eloquent'   => 'Enforce\Model',

),
```

### Configuration

[](#configuration)

Enforce uses the standard Laravel config. Create `app/config/enforce.php` with the following:

```
