@@ -40,40 +40,40 @@ If you also want the roles and permissions to use a UUID for their `id` value, t
40
40
});
41
41
42
42
Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) {
43
- - $table->unsignedBigInteger(PermissionRegistrar:: $pivotPermission);
44
- + $table->uuid(PermissionRegistrar:: $pivotPermission);
43
+ - $table->unsignedBigInteger($pivotPermission);
44
+ + $table->uuid($pivotPermission);
45
45
$table->string('model_type');
46
46
//...
47
- $table->foreign(PermissionRegistrar:: $pivotPermission)
47
+ $table->foreign($pivotPermission)
48
48
- ->references('id') // permission id
49
49
+ ->references('uuid') // permission id
50
50
->on($tableNames['permissions'])
51
51
->onDelete('cascade');
52
52
//...
53
53
54
54
Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) {
55
- - $table->unsignedBigInteger(PermissionRegistrar:: $pivotRole);
56
- + $table->uuid(PermissionRegistrar:: $pivotRole);
55
+ - $table->unsignedBigInteger($pivotRole);
56
+ + $table->uuid($pivotRole);
57
57
//...
58
- $table->foreign(PermissionRegistrar:: $pivotRole)
58
+ $table->foreign($pivotRole)
59
59
- ->references('id') // role id
60
60
+ ->references('uuid') // role id
61
61
->on($tableNames['roles'])
62
62
->onDelete('cascade');//...
63
63
64
64
Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
65
- - $table->unsignedBigInteger(PermissionRegistrar:: $pivotPermission);
66
- - $table->unsignedBigInteger(PermissionRegistrar:: $pivotRole);
67
- + $table->uuid(PermissionRegistrar:: $pivotPermission);
68
- + $table->uuid(PermissionRegistrar:: $pivotRole);
65
+ - $table->unsignedBigInteger($pivotPermission);
66
+ - $table->unsignedBigInteger($pivotRole);
67
+ + $table->uuid($pivotPermission);
68
+ + $table->uuid($pivotRole);
69
69
70
- $table->foreign(PermissionRegistrar:: $pivotPermission)
70
+ $table->foreign($pivotPermission)
71
71
- ->references('id') // permission id
72
72
+ ->references('uuid') // permission id
73
73
->on($tableNames['permissions'])
74
74
->onDelete('cascade');
75
75
76
- $table->foreign(PermissionRegistrar:: $pivotRole)
76
+ $table->foreign($pivotRole)
77
77
- ->references('id') // role id
78
78
+ ->references('uuid') // role id
79
79
->on($tableNames['roles'])
0 commit comments