wip
This commit is contained in:
@@ -8,6 +8,10 @@ class Application extends BaseModel
|
||||
{
|
||||
return $this->belongsTo(Environment::class);
|
||||
}
|
||||
public function settings()
|
||||
{
|
||||
return $this->hasOne(ApplicationSetting::class);
|
||||
}
|
||||
public function destination()
|
||||
{
|
||||
return $this->morphTo();
|
||||
@@ -16,4 +20,8 @@ class Application extends BaseModel
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
public function deployments()
|
||||
{
|
||||
return $this->morphMany(Deployment::class, 'type');
|
||||
}
|
||||
}
|
||||
|
||||
9
app/Models/ApplicationSetting.php
Normal file
9
app/Models/ApplicationSetting.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ApplicationSetting extends Model
|
||||
{
|
||||
}
|
||||
11
app/Models/CoolifyInstanceSettings.php
Normal file
11
app/Models/CoolifyInstanceSettings.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CoolifyInstanceSettings extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
||||
@@ -12,4 +12,8 @@ class Database extends BaseModel
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
public function deployments()
|
||||
{
|
||||
return $this->morphMany(Deployment::class, 'type');
|
||||
}
|
||||
}
|
||||
|
||||
24
app/Models/Deployment.php
Normal file
24
app/Models/Deployment.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Spatie\Activitylog\Models\Activity;
|
||||
|
||||
class Deployment extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'uuid',
|
||||
'type_id',
|
||||
'type_type',
|
||||
'activity_log_id',
|
||||
];
|
||||
public function type()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
public function activity()
|
||||
{
|
||||
return $this->belongsTo(Activity::class, 'activity_log_id');
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,10 @@ namespace App\Models;
|
||||
|
||||
class Environment extends BaseModel
|
||||
{
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo(Project::class);
|
||||
}
|
||||
public function applications()
|
||||
{
|
||||
return $this->hasMany(Application::class);
|
||||
|
||||
@@ -8,4 +8,8 @@ class StandaloneDocker extends BaseModel
|
||||
{
|
||||
return $this->morphMany(Application::class, 'destination');
|
||||
}
|
||||
public function server()
|
||||
{
|
||||
return $this->belongsTo(Server::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user