Add the clone method for Item model.
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-06-19 18:13:35 +03:00
parent ada0abd69d
commit 6bb99c7f70
+9
View File
@@ -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);