first upload all files

This commit is contained in:
NW
2023-06-11 13:14:03 +01:00
parent f14dbc52b5
commit c08b36d1b6
1705 changed files with 106852 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace Modules\Product;
use Darryldecode\Cart\Cart as DarryldecodeCart;
class RecentlyViewed extends DarryldecodeCart
{
public function store($product)
{
$product->load('reviews');
$this->remove($product->id);
return $this->add([
'id' => $product->id,
'name' => $product->name,
'price' => $product->selling_price->amount(),
'quantity' => 1,
'attributes' => compact('product'),
]);
}
public function products()
{
return $this->getContent()->map(function ($item) {
return $item->attributes->product;
});
}
}