36 lines
742 B
PHP
36 lines
742 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\EnvironmentAttachmentRole;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class EnvironmentAttachment extends Model
|
|
{
|
|
protected $guarded = [];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_primary' => 'boolean',
|
|
'role' => EnvironmentAttachmentRole::class,
|
|
];
|
|
}
|
|
|
|
public function environment(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Environment::class);
|
|
}
|
|
|
|
public function service(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Service::class);
|
|
}
|
|
|
|
public function serviceSlice(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ServiceSlice::class);
|
|
}
|
|
}
|