From 28411a120e7967a884f23184bea684f96022a8b5 Mon Sep 17 00:00:00 2001 From: arfenis Date: Tue, 30 Jul 2024 17:36:59 -0400 Subject: [PATCH] Add fields to algolia --- src/Domains/Inventory/Products/Models/Products.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Domains/Inventory/Products/Models/Products.php b/src/Domains/Inventory/Products/Models/Products.php index afacefaa7..4563213ae 100644 --- a/src/Domains/Inventory/Products/Models/Products.php +++ b/src/Domains/Inventory/Products/Models/Products.php @@ -185,13 +185,18 @@ public function toSearchableArray(): array 'variants' => $this->variants->map(function ($variant) { return $variant->toSearchableArray(); }), + 'status' => [ + 'id' => $this->status->id ?? null, + 'name' => $this->status->name ?? null, + ], 'uuid' => $this->uuid, 'slug' => $this->slug, 'description' => $this->description, 'short_description' => $this->short_description, 'attributes' => [], 'apps_id' => $this->apps_id, - 'is_deleted' => $this->is_deleted, + 'published_at' => $this->published_at, + 'created_at' => $this->created_at->format('Y-m-d H:i:s'), ]; $attributes = $this->attributes()->get(); foreach ($attributes as $attribute) {