minor fixes

This commit is contained in:
ludo
2024-02-23 08:35:41 +01:00
parent fb6da523fa
commit cc411cba68
47 changed files with 148 additions and 2458 deletions

View File

@@ -10,24 +10,19 @@ class BasketStores
{
use Basic;
public function has($key)
public static function has($key)
{
return Basket::find($key);
}
public function get($key)
public static function get($key)
{
if ($this->has($key)) {
return new CartCollection(Basket::find($key)->cart_data);
} else {
return [];
}
return self::has($key) ? new CartCollection(Basket::find($key)->cart_data) : [];
}
public function put($key, $value)
public static function put($key, $value)
{
if ($row = Basket::find($key)) {
// update
$row->cart_data = $value;
$row->save();
} else {