coding style
This commit is contained in:
@@ -17,7 +17,7 @@ class BasketStores
|
||||
|
||||
public function get($key)
|
||||
{
|
||||
if($this->has($key)) {
|
||||
if ($this->has($key)) {
|
||||
return new CartCollection(Basket::find($key)->cart_data);
|
||||
} else {
|
||||
return [];
|
||||
@@ -26,14 +26,14 @@ class BasketStores
|
||||
|
||||
public function put($key, $value)
|
||||
{
|
||||
if($row = Basket::find($key)) {
|
||||
if ($row = Basket::find($key)) {
|
||||
// update
|
||||
$row->cart_data = $value;
|
||||
$row->save();
|
||||
} else {
|
||||
Basket::create([
|
||||
'id' => $key,
|
||||
'cart_data' => $value
|
||||
'cart_data' => $value,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -41,5 +41,5 @@ class BasketStores
|
||||
public static function getModel()
|
||||
{
|
||||
return Basket::query();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user