-
Notifications
You must be signed in to change notification settings - Fork 330
Installation
Tom Witkowski edited this page Dec 8, 2015
·
1 revision
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:
- Add a new item to the
providers
array:
Silber\Bouncer\BouncerServiceProvider::class
- 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.
- Add the bouncer's trait to your user model:
use Silber\Bouncer\Database\HasRolesAndAbilities;
class User extends Model
{
use HasRolesAndAbilities;
}
- 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"
- Finally, run the migrations:
$ php artisan migrate