Merge remote-tracking branch 'origin/v4' into ijpatricio-wip-4

# Conflicts:
#	bootstrap/helpers.php
#	docker/dev/supervisord.conf
This commit is contained in:
Joao Patricio committed 2023-03-31 10:56:46 +01:00
commit 2d25d3848c
31 files changed
+373 -194

No files matched your search

+3
View File
@@ -18,4 +18,7 @@ class Project extends BaseModel
public function settings() {
return $this->hasOne(ProjectSetting::class);
}
public function applications() {
return $this->hasManyThrough(Application::class, Environment::class);
}
}
+12
View File
@@ -4,8 +4,20 @@ namespace App\Models;
class Server extends BaseModel
{
protected static function booted()
{
static::created(function ($server) {
ServerSetting::create([
'server_id' => $server->id,
]);
});
}
public function privateKey()
{
return $this->belongsTo(PrivateKey::class);
}
public function settings()
{
return $this->hasOne(ServerSetting::class);
}
}
+11
View File
@@ -0,0 +1,11 @@
<?php
namespace App\Models;
class ServerSetting extends BaseModel
{
public function server()
{
return $this->belongsTo(Server::class);
}
}
+3
View File
@@ -16,4 +16,7 @@ class Team extends BaseModel
public function servers() {
return $this->hasMany(Server::class);
}
public function applications() {
return $this->hasManyThrough(Application::class, Project::class);
}
}