minor fixes
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user