PHPackages                             rappasoft/vault - 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. rappasoft/vault

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

rappasoft/vault
===============

Vault, Laravel 5 Roles &amp; Permissions

v0.1-alpha(11y ago)1031.6k9[5 issues](https://github.com/rappasoft/vault/issues)[1 PRs](https://github.com/rappasoft/vault/pulls)MITPHPPHP &gt;=5.4.0

Since Feb 3Pushed 9y ago13 watchersCompare

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

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

\##This package is no longer maintained. Please use the [full boilerplate](http://www.laravel-boilerplate.com) instead.

Vault (Laravel 5 Package)
=========================

[](#vault-laravel-5-package)

[![Project Status](https://camo.githubusercontent.com/0954b71f6e315e30b53f0898f95ec9dce61a6704bb5982ef316ac88a3979801e/687474703a2f2f7374696c6c6d61696e7461696e65642e636f6d2f7261707061736f66742f7661756c742e706e67)](http://stillmaintained.com/rappasoft/vault)[![Build Status](https://camo.githubusercontent.com/e3ea05ba2a64c4a2919047fcb5f0714103abec42de74e51b9c6b35150144080a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7261707061736f66742f7661756c742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rappasoft/vault/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/665dfc718f6ca659a21e7d1c20bc262a452a3472b7d22702820c19e59eaf8312/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7261707061736f66742f7661756c742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rappasoft/vault/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/42e3bb5a245f9fe08b33aabb25cd7fe01d2d0d6430fbd807bb31097a8d60e4b1/68747470733a2f2f706f7365722e707567782e6f72672f7261707061736f66742f7661756c742f646f776e6c6f6164732e737667)](https://packagist.org/packages/rappasoft/vault)[![License](https://camo.githubusercontent.com/4caf4aee805e7030c53338936431f1567947d0d26ac89c568410e930d580cc82/68747470733a2f2f706f7365722e707567782e6f72672f7261707061736f66742f7661756c742f6c6963656e73652e737667)](https://packagist.org/packages/rappasoft/vault)

Vault is a simple yet powerful access control system for the new Laravel 5 Framework. It comes with a backend user interface to manage users, roles, and permissions as well as the relationships between them.

**Be advised while this package works fully, it is still in development and the code base changes often. A 1.0 tag will be created when the package is stable for release.**

**Examples:**[Vault User Index](http://i.imgur.com/yZ80ySY.png)[Vault Create Role](http://i.imgur.com/R4yE7nF.png)[Vault Edit User](http://i.imgur.com/5ZIRcGV.png)[Vault Role Index](http://i.imgur.com/zmfGeEr.png)

Documentation
-------------

[](#documentation)

- [Setup](#setup)
    - [Publishing Assets](#publish)
    - [UserHasRole trait](#userhasrole)
    - [Dummy Data](#seeding)
    - [Route Middleware](#middleware)
- \[Configuration\] (#configuration)
    - [Config File](#config_file)
    - [Vault Views](#vault_views)
    - [Vault Routes](#vault_routes)
    - [Status Property](#status_property)
    - [Route Middleware](#route_middleware)
        - [Parameters](#route_middleware_params)
        - [Creating Middleware](#creating_middleware)
        - [VaultRoute trait](#vault_route_trait)
    - [Blade Extensions](#blade_extensions)
- \[License\] (#license)
- \[Issues\] (#issues)

Prerequisites
-------------

[](#prerequisites)

- This package assumes you have an installation of Laravel 5 using the pre-packaged authentication library and functionality. For a brand new project, I recommend using my [Laravel 5 Boilerplate Package](https://github.com/rappasoft/laravel-5-boilerplate) and requiring this library.
- User model must have soft deletes enabled.

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

```
"rappasoft/vault": "dev-master"

```

Run the Composer update command

```
$ composer update

```

In your `config/app.php` add the following to your `$providers` and `$aliases` array

```
'providers' => [

    App\Providers\EventServiceProvider::class,
    App\Providers\RouteServiceProvider::class,
    ...
    Rappasoft\Vault\VaultServiceProvider::class,
    Illuminate\Html\HtmlServiceProvider::class,

],
```

```
'aliases' => [

    'App'       => Illuminate\Support\Facades\App::class,
    ...
    'Form'		=> Illuminate\Html\FormFacade::class,
    'HTML'		=> Illuminate\Html\HtmlFacade::class

],
```

**The Vault Facade is loaded by the service provider by default.**

Run the `vendor:publish` command ```
$ php artisan vendor:publish --provider="Rappasoft\Vault\VaultServiceProvider"

```

This will publish the following files to your application:

- app/config/vault.php config file
- Vault Migration File
- Vault Seed File (Will add the seed call to the end of your DatabaseSeeder.php class)
- public/js/vault/\*
- public/css/vault/\*

You can also publish individual assets by tag if need be:

```
$ php artisan vendor:publish --provider="Rappasoft\Vault\VaultServiceProvider" --tag="config"
$ php artisan vendor:publish --provider="Rappasoft\Vault\VaultServiceProvider" --tag="migration"
$ php artisan vendor:publish --provider="Rappasoft\Vault\VaultServiceProvider" --tag="seeder"
$ php artisan vendor:publish --provider="Rappasoft\Vault\VaultServiceProvider" --tag="assets"

```

**You can also publish views, see configuration below.**

Run the `dumpautoload` command

```
$ composer dumpautoload -o

```

Run the `migration` command

```
$ php artisan migrate

```

Add the `UserHasRole` trait to your User model: ```
