Skip to content

Commit 9324df3

Browse files
committed
update
1 parent a22c820 commit 9324df3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/Http/Resources/ProductResource.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\Models\Town;
66
use App\Models\Product;
7+
use App\Models\FeedBack;
78
use App\Models\OrderDetail;
89
use Illuminate\Http\Request;
910
use App\Models\WholeSalePrice;
@@ -50,6 +51,7 @@ public function toArray(Request $request): array
5051
"product_quantity" => $this->product_quantity,
5152
"product_categories" => CategoryResource::collection($this->categories),
5253
"residence"=>Town::where('id',$this->product_residence)->select('town_name')->first()->town_name,
54+
"feedbacks"=>FeedBack::where('product_id',"!=",null)->get()->last(),
5355
"status" => $this->status,
5456
"isSubscribe" => $this->isSubscribe,
5557
"variations" => $this->getVariations(),

0 commit comments

Comments
 (0)