*/ use HasFactory, SoftDeletes; protected $fillable = [ 'order_id', 'service_file_id', 'service_type', 'placement', 'amount', 'amount_price', 'notes', ]; protected $appends = [ 'service_file_name', 'service_file_setup_number', 'service_file_width', 'service_file_height', 'service_file_code', ]; public function getServiceFileNameAttribute(): string { return $this->serviceFile->name ?? ''; } public function getServiceFileSetupNumberAttribute(): string { return $this->serviceFile->setup_number ?? ''; } public function getServiceFileWidthAttribute(): string { return $this->serviceFile->width ?? ''; } public function getServiceFileHeightAttribute(): string { return $this->serviceFile->height ?? ''; } public function getServiceFileCodeAttribute(): string { return $this->serviceFile->code ?? ''; } public function setServiceFileName(string $name): void { $this->serviceFile->name = $name; } /** * @return BelongsTo */ public function order(): BelongsTo { return $this->belongsTo(Order::class); } /** * @return BelongsTo */ public function serviceFile(): BelongsTo { return $this->BelongsTo(ServiceFile::class); } }