Skip to content

Commit

Permalink
Change bouncer seeding method names
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephSilber committed Nov 29, 2015
1 parent 4c3631d commit 9489bf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ Depending on your project, you might have a set of roles and abilities that you
First, register your seeding callback in your `AppServiceProvider`'s `boot` method:

```php
Bouncer::seed(function () {
Bouncer::seeder(function () {
Bouncer::allow('admin')->to(['ban-users', 'delete-posts']);
Bouncer::allow('editor')->to(['delete-posts']);
});
Expand All @@ -300,7 +300,7 @@ Bouncer::seed(function () {
You can also register a seeder class to be used for seeding:

```php
Bouncer::seed('MySeeder');
Bouncer::seeder('MySeeder');
```

By default, the `seed` method will be called. You can specify a different method by using `@` notation e.g. `MySeeder@run`.
Expand All @@ -311,10 +311,10 @@ Once you've registered your seeder, you can run the seeds via the included artis
$ php artisan bouncer:seed
```

You can also run the seeds from within your codebase:
Should you find a need to run the seeds from within your codebase, you can do that too:

```php
Bouncer::runSeeds();
Bouncer::seed();
```

Note that it's ok to run the seeds multiple times. If you make a change to your seeder, simply run the seeder again. Do note however that any information that has previously been seeded will *not* be automatically reverted.
Expand Down Expand Up @@ -353,8 +353,8 @@ Bouncer::cache();
Bouncer::refresh();
Bouncer::refreshFor($user);

Bouncer::seed($callback);
Bouncer::runSeeds();
Bouncer::seeder($callback);
Bouncer::seed();
```

Some of this functionality is also available directly on the user model:
Expand Down
4 changes: 2 additions & 2 deletions src/Bouncer.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(CachedClipboard $clipboard, Seeder $seeder)
* @param \Closure|string $seeder
* @return $this
*/
public function seed($seeder)
public function seeder($seeder)
{
$this->seeder->register($seeder);

Expand All @@ -70,7 +70,7 @@ public function seed($seeder)
*
* @return $this
*/
public function runSeeds()
public function seed()
{
$this->seeder->run();

Expand Down

0 comments on commit 9489bf1

Please sign in to comment.