fixed url for category and product
This commit is contained in:
parent
b394063f0f
commit
1b07e010f8
|
|
@ -18,6 +18,7 @@ class CategoryList extends JsonResource
|
|||
$item = [
|
||||
'id' => $this->id,
|
||||
'name' => $this->description->name ?? '',
|
||||
'url' => url()->route('shop.categories.show', ['category' => $this])
|
||||
];
|
||||
|
||||
if ($this->relationLoaded('children') && $this->children->count() > 0) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class ProductList extends JsonResource
|
|||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->description->name ?? '',
|
||||
'url' => url()->route('shop.products.show', ['product' => $this]),
|
||||
'price' => $this->price,
|
||||
'image' => image_resize($this->image),
|
||||
'price_format' => currency_format($this->price),
|
||||
|
|
|
|||
Loading…
Reference in New Issue