mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 10:15:40 +00:00
testing php storm code cleanup and styling
This commit is contained in:
1 parent
a8ee779b31
commit
f2228cec7b
368 files changed
+23834
-2623
No files matched your search
+22
-13
@@ -11,32 +11,41 @@ class Environment extends Model
|
||||
'name',
|
||||
'project_id',
|
||||
];
|
||||
protected function name(): Attribute
|
||||
|
||||
public function can_delete_environment()
|
||||
{
|
||||
return Attribute::make(
|
||||
set: fn (string $value) => strtolower($value),
|
||||
);
|
||||
}
|
||||
public function can_delete_environment() {
|
||||
return $this->applications()->count() == 0 && $this->postgresqls()->count() == 0;
|
||||
}
|
||||
public function databases() {
|
||||
return $this->postgresqls();
|
||||
}
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo(Project::class);
|
||||
}
|
||||
|
||||
public function applications()
|
||||
{
|
||||
return $this->hasMany(Application::class);
|
||||
}
|
||||
|
||||
public function postgresqls()
|
||||
{
|
||||
return $this->hasMany(StandalonePostgresql::class);
|
||||
}
|
||||
|
||||
public function databases()
|
||||
{
|
||||
return $this->postgresqls();
|
||||
}
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo(Project::class);
|
||||
}
|
||||
|
||||
public function services()
|
||||
{
|
||||
return $this->hasMany(Service::class);
|
||||
}
|
||||
|
||||
protected function name(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
set: fn(string $value) => strtolower($value),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user