1
1
<?php
2
2
3
- use Illuminate\Support\Facades\Schema;
4
- use Illuminate\Database\Schema\Blueprint;
5
3
use Illuminate\Database\Migrations\Migration;
4
+ use Illuminate\Database\Schema\Blueprint;
5
+ use Illuminate\Support\Facades\Schema;
6
6
7
7
return new class extends Migration
8
8
{
@@ -24,8 +24,8 @@ return new class extends Migration
24
24
throw new \Exception('Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.');
25
25
}
26
26
27
- Schema::create($tableNames['permissions'], function (Blueprint $table) {
28
- //$table->engine('InnoDB');
27
+ Schema::create($tableNames['permissions'], static function (Blueprint $table) {
28
+ // $table->engine('InnoDB');
29
29
$table->bigIncrements('id'); // permission id
30
30
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
31
31
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
@@ -34,8 +34,8 @@ return new class extends Migration
34
34
$table->unique(['name', 'guard_name']);
35
35
});
36
36
37
- Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
38
- //$table->engine('InnoDB');
37
+ Schema::create($tableNames['roles'], static function (Blueprint $table) use ($teams, $columnNames) {
38
+ // $table->engine('InnoDB');
39
39
$table->bigIncrements('id'); // role id
40
40
if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
41
41
$table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
@@ -51,7 +51,7 @@ return new class extends Migration
51
51
}
52
52
});
53
53
54
- Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames, $pivotPermission, $teams) {
54
+ Schema::create($tableNames['model_has_permissions'], static function (Blueprint $table) use ($tableNames, $columnNames, $pivotPermission, $teams) {
55
55
$table->unsignedBigInteger($pivotPermission);
56
56
57
57
$table->string('model_type');
@@ -75,7 +75,7 @@ return new class extends Migration
75
75
76
76
});
77
77
78
- Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames, $pivotRole, $teams) {
78
+ Schema::create($tableNames['model_has_roles'], static function (Blueprint $table) use ($tableNames, $columnNames, $pivotRole, $teams) {
79
79
$table->unsignedBigInteger($pivotRole);
80
80
81
81
$table->string('model_type');
@@ -98,7 +98,7 @@ return new class extends Migration
98
98
}
99
99
});
100
100
101
- Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames, $pivotRole, $pivotPermission) {
101
+ Schema::create($tableNames['role_has_permissions'], static function (Blueprint $table) use ($tableNames, $pivotRole, $pivotPermission) {
102
102
$table->unsignedBigInteger($pivotPermission);
103
103
$table->unsignedBigInteger($pivotRole);
104
104
0 commit comments