coolify/app/Models/Application.php
Andras Bacsai 78c4344583 feat: add deployments as activity
fix: tests
refactor: remoteProcess
2023-03-29 12:27:02 +02:00

31 lines
663 B
PHP

<?php
namespace App\Models;
use Spatie\Activitylog\Models\Activity;
class Application extends BaseModel
{
public function environment()
{
return $this->belongsTo(Environment::class);
}
public function settings()
{
return $this->hasOne(ApplicationSetting::class);
}
public function destination()
{
return $this->morphTo();
}
public function source()
{
return $this->morphTo();
}
public function get_deployment(string $deployment_uuid)
{
return Activity::where('subject_id', $this->id)->where('properties->deployment_uuid', '=', $deployment_uuid)->first();
}
}