diff options
author | Sam Light <samlight1994@gmail.com> | 2025-03-28 01:07:59 +0000 |
---|---|---|
committer | Sam Light <samlight1994@gmail.com> | 2025-03-28 01:07:59 +0000 |
commit | 80a183a94bd344c3ac08109019fdc7d341a57a6e (patch) | |
tree | 94430858a1a39219fe73f83b4c85e0f5cd3a0b1c /workbench/database/factories | |
parent | 1f81ce361cb454b1655d6e2a7ac031bc1e3b2ede (diff) |
Setup categories table, model and factory
Diffstat (limited to 'workbench/database/factories')
-rw-r--r-- | workbench/database/factories/CategoryFactory.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/workbench/database/factories/CategoryFactory.php b/workbench/database/factories/CategoryFactory.php new file mode 100644 index 0000000..756c22a --- /dev/null +++ b/workbench/database/factories/CategoryFactory.php @@ -0,0 +1,33 @@ +<?php + +namespace Workbench\Database\Factories; + +use Illuminate\Database\Eloquent\Factories\Factory; +use Workbench\App\Models\Category; + +/** + * @template TModel of \Workbench\App\Models\Category + * + * @extends \Illuminate\Database\Eloquent\Factories\Factory<TModel> + */ +class CategoryFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var class-string<TModel> + */ + protected $model = Category::class; + + /** + * Define the model's default state. + * + * @return array<string, mixed> + */ + public function definition(): array + { + return [ + 'name' => fake()->text(20), + ]; + } +} |