From 73b45084b7f7e10540d7e9129c5929d4c5544c49 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Mon, 19 Jun 2023 18:08:34 +0300 Subject: [PATCH] Refactor the Cart method names. --- app/Models/Cart.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Models/Cart.php b/app/Models/Cart.php index 3217903..c8f191b 100644 --- a/app/Models/Cart.php +++ b/app/Models/Cart.php @@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use App\Models\City; use App\Models\Company; -use Brick\Math\BigInteger; class Cart extends Model { @@ -87,22 +86,22 @@ class Cart extends Model $this->save(); } - public function addItem(BigInteger $item) + public function addItemId(int $item) { $this->items()->sync($item); } - public function addItems(array $items) + public function addItemIds(array $items) { $this->items()->sync($items); } - public function removeItem(BigInteger $item) + public function removeItemId(int $item) { $this->items()->sync($item); } - public function removeItems(array $items) + public function removeItemIds(array $items) { $this->items()->sync($items); }