belongsTo(Contractor::class); } public function product(): BelongsTo { return $this->belongsTo(Product::class, 'product_id')->withoutGlobalScope(\App\Models\Scopes\YearScope::class)->withTrashed(); } protected function price(): Attribute { return Attribute::make( get: fn(int|null $value) => (float) ($value ?? 0) / 100, set: fn(float|int|string|null $value) => (int) round(((float) ($value ?? 0)) * 100), ); } protected function priceTxt(): Attribute { return Attribute::make( get: fn() => Price::format($this->price), ); } }