'array', 'features' => 'array', 'pricing_tables' => 'array', 'seo' => 'array', 'game_preview' => 'array', 'game_panel' => 'array', 'faqs' => 'array', ]; protected function heroSection(): Attribute { return Attribute::make( get: fn ($value) => json_decode($value, true) ?? [], set: fn ($value) => json_encode($value), ); } public function category() { return $this->belongsTo(Category::class); } public function getMinPriceDetailsAttribute() { if (!$this->category) { return null; } $minPrice = $this->category->products() ->join('plans', function ($join) { $join->on('plans.priceable_id', '=', 'products.id') ->where('plans.priceable_type', '=', 'App\\Models\\Product'); }) ->join('prices', function ($join) { $join->on('prices.plan_id', '=', 'plans.id'); }) ->select('prices.price', 'prices.currency_code') ->orderBy('prices.price', 'asc') ->first(); return $minPrice ? [ 'price' => $minPrice->price, 'currency_code' => $minPrice->currency_code, ] : null; } }