Refactor to remove slices and environments, replace with instances.

This commit is contained in:
2025-09-15 12:19:13 +01:00
parent a91780d1d5
commit 65d3142d03
24 changed files with 454 additions and 290 deletions

34
app/Models/Instance.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphMany;
class Instance extends Model
{
protected $guarded = [];
protected function casts(): array
{
return [
'config' => 'array',
];
}
public function application(): BelongsTo
{
return $this->belongsTo(Application::class);
}
public function server(): BelongsTo
{
return $this->belongsTo(Server::class);
}
public function deployments(): MorphMany
{
return $this->morphMany(Deployment::class, 'target');
}
}