diff --git a/app/Models/Item.php b/app/Models/Item.php index f4e5bee..1ad194c 100644 --- a/app/Models/Item.php +++ b/app/Models/Item.php @@ -34,6 +34,15 @@ class Item extends Model $this->save(); } + public function clone($count = 1): Item + { + $copyItem = $this->replicate(); + + $copyItem->setCount($count); + + return $copyItem; + } + public function category(): BelongsTo { return $this->belongsTo(Category::class);