Skip to content

Commit 546ad78

Browse files
committed
updates readme and renames unique indexes
1 parent 23b2998 commit 546ad78

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ Then if you need to use one of the provided middleware, you can add a `auth.grou
2626
```
2727
This one insures that user belongs to all required auth groups
2828

29+
### Publish config and migrations
30+
```bash
31+
php artisan vendor:publish
32+
```
33+
and pick `Provider: Denismitr\Permissions\PermissionsServiceProvider` from the list
34+
2935
### Migration
3036

3137
Then run `php artisan migrate` and the following _5_ tables will be created:

migrations/create_laravel_permissions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function up()
4646
->on('auth_groups')
4747
->onDelete('cascade');
4848

49-
$table->unique(['permission_id', 'auth_group_id']);
49+
$table->unique(['permission_id', 'auth_group_id'], 'lp_agp_unique');
5050
});
5151

5252
Schema::create('auth_group_users', function (Blueprint $table) {
@@ -65,7 +65,7 @@ public function up()
6565
->on('users')
6666
->onDelete('cascade');
6767

68-
$table->unique(['user_id', 'auth_group_id']);
68+
$table->unique(['user_id', 'auth_group_id'], 'lp_agu_unique');
6969
});
7070

7171
Schema::create('auth_group_user_permissions', function (Blueprint $table) {
@@ -84,7 +84,7 @@ public function up()
8484
->on('permissions')
8585
->onDelete('cascade');
8686

87-
$table->unique(['auth_group_user_id', 'permission_id']);
87+
$table->unique(['auth_group_user_id', 'permission_id'], 'lp_agup_unique');
8888
});
8989

9090
Schema::table(config('permissions.tables.users'), function (Blueprint $table) {

0 commit comments

Comments
 (0)