(float) $value / 100, set: fn (float $value) => (int) ($value * 100), ); } protected function installationPrice(): Attribute { return Attribute::make( get: fn(int $value) => (float) $value / 100, set: fn (float $value) => (int) ($value * 100), ); } protected function servicePrice(): Attribute { return Attribute::make( get: fn(int $value) => (float) $value / 100, set: fn (float $value) => (int) ($value * 100), ); } protected function totalPrice(): Attribute { return Attribute::make( get: fn(int $value) => (float) $value / 100, set: fn (float $value) => (int) ($value * 100), ); } public function productPriceTxt(): Attribute { return Attribute::make( get: fn($value) => Price::format($this->product_price), ); } public function installationPriceTxt(): Attribute { return Attribute::make( get: fn($value) => Price::format($this->installation_price), ); } protected function servicePriceTxt(): Attribute { return Attribute::make( get: fn($value) => Price::format($this->service_price), ); } protected function totalPriceTxt(): Attribute { return Attribute::make( get: fn($value) => Price::format($this->total_price), ); } /** * @param $column * @return array */ public static function getFilters($column): array { return DB::table('products') ->select($column) ->distinct() ->get() ->pluck($column) ->toArray(); } }