Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PublishMigrations #257

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ composer require kodeine/laravel-acl "^1.0"
],
```

3. Publish the package configuartion files and add your own models to the list of ACL models"
3. Publish the package configuartion files, migrations and add your own models to the list of ACL models"

```
$ php artisan vendor:publish --provider="Kodeine\Acl\AclServiceProvider"
Expand Down
26 changes: 14 additions & 12 deletions src/Kodeine/Acl/AclServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,20 @@ class AclServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->publishConfig();
$this->loadMigrationsFrom(__DIR__ . '/../../migrations');
$this->publishes(
[
__DIR__ . '/../../config/acl.php' => config_path('acl.php')
],
'config'
);

$this->publishes(
[
__DIR__ . '/../../migrations/' => base_path('/database/migrations')
],
'migrations'
);

$this->registerBladeDirectives();
}

Expand All @@ -38,16 +50,6 @@ public function register()
);
}

/**
* Publish the config file to the application config directory
*/
public function publishConfig()
{
$this->publishes([
__DIR__ . '/../../config/acl.php' => config_path('acl.php'),
], 'config');
}

public function registerBladeDirectives()
{
// role
Expand Down