Refactor Application model and migration
This commit is contained in:
parent
78b194cb16
commit
13bceb934f
@ -215,6 +215,26 @@ public function portsMappingsArray(): Attribute
|
||||
|
||||
);
|
||||
}
|
||||
public function status(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
set: function ($value) {
|
||||
if ($this->additional_networks->count() === 0) {
|
||||
return $value;
|
||||
} else {
|
||||
return 'complex';
|
||||
}
|
||||
|
||||
},
|
||||
get: function ($value) {
|
||||
if ($this->additional_networks->count() === 0) {
|
||||
return $value;
|
||||
} else {
|
||||
return 'complex';
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
public function portsExposesArray(): Attribute
|
||||
{
|
||||
|
@ -20,7 +20,6 @@ public function up(): void
|
||||
});
|
||||
Schema::table('applications', function (Blueprint $table) {
|
||||
$table->dropColumn('additional_destinations');
|
||||
$table->text('complex_status')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@ -32,7 +31,6 @@ public function down(): void
|
||||
Schema::dropIfExists('additional_destinations');
|
||||
Schema::table('applications', function (Blueprint $table) {
|
||||
$table->string('additional_destinations')->nullable()->after('destination');
|
||||
$table->dropColumn('complex_status');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user