File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,19 @@ public function down(): void
130
130
'model_has_roles' => 'model_has_roles',
131
131
'role_has_permissions' => 'role_has_permissions',
132
132
]);
133
-
133
+ // Add Title columns in case they don't exist.
134
+ $roles = $tableNames['roles'];
135
+ $permissions = $tableNames['permissions'];
136
+ Schema::table($roles, function (Blueprint $table) use($roles) {
137
+ $hasTitle = Schema::hasColumn($roles,"title");
138
+ if (!$hasTitle) $table->string('title')->nullable();
139
+ });
140
+ Schema::table($permissions, function (Blueprint $table) use ($permissions) {
141
+ if (!Schema::hasColumn($permissions,"title")) {
142
+ $table->string('title')->nullable();
143
+ }
144
+ });
145
+ // End add title
134
146
DB::transaction(function () use ($tableNames){
135
147
foreach ($this->permissions as $permission) {
136
148
$permissionItem = DB::table($tableNames['permissions'])->where([
You can’t perform that action at this time.
0 commit comments