summaryrefslogtreecommitdiff
path: root/workbench/app/Models/Category.php
diff options
context:
space:
mode:
Diffstat (limited to 'workbench/app/Models/Category.php')
-rw-r--r--workbench/app/Models/Category.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/workbench/app/Models/Category.php b/workbench/app/Models/Category.php
new file mode 100644
index 0000000..d1b1dcd
--- /dev/null
+++ b/workbench/app/Models/Category.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Workbench\App\Models;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Model;
+
+class Category extends Model
+{
+ use HasFactory;
+
+ protected static function newFactory()
+ {
+ return \Workbench\Database\Factories\CategoryFactory::new();
+ }
+
+ public function products(): HasMany
+ {
+ return $this->hasMany(Product::class);
+ }
+}