Skip to content
Tom Witkowski edited this page Dec 8, 2015 · 1 revision

Installation

Simply install the bouncer package with composer:

$ composer require silber/bouncer

Once the composer installation completes, you can add the service provider and alias the facade. Open config/app.php, and make the following changes:

  1. Add a new item to the providers array:
Silber\Bouncer\BouncerServiceProvider::class
  1. Add a new item to the aliases array:
'Bouncer' => Silber\Bouncer\BouncerFacade::class

This part is optional. If you don't want to use the facade, you can skip step 2.

  1. Add the bouncer's trait to your user model:
use Silber\Bouncer\Database\HasRolesAndAbilities;

class User extends Model
{
    use HasRolesAndAbilities;
}
  1. Now, to run the bouncer's migrations, first publish the package's migrations into your app's migrations directory, by running the following command:
$ php artisan vendor:publish --provider="Silber\Bouncer\BouncerServiceProvider" --tag="migrations"
  1. Finally, run the migrations:
$ php artisan migrate
Clone this wiki locally