lasthourcloud/app/Models/Project.php
Andras Bacsai da2deb85c4 wip
2023-03-30 21:15:25 +02:00

25 lines
581 B
PHP

<?php
namespace App\Models;
class Project extends BaseModel
{
protected static function booted()
{
static::created(function ($project) {
ProjectSetting::create([
'project_id' => $project->id,
]);
});
}
public function environments() {
return $this->hasMany(Environment::class);
}
public function settings() {
return $this->hasOne(ProjectSetting::class);
}
public function applications() {
return $this->hasManyThrough(Application::class, Environment::class);
}
}