blob: 081e1960a5bec9c86426587d5af73f76ab47967f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<?php
namespace Workbench\Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Workbench\App\Models\Product;
/**
* @template TModel of \Workbench\App\Models\Product
*
* @extends \Illuminate\Database\Eloquent\Factories\Factory<TModel>
*/
class ProductFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var class-string<TModel>
*/
protected $model = Product::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->text(30),
'description' => fake()->text(100),
'price' => fake()->randomFloat(2, 1, 300),
'stock' => fake()->numberBetween(0, 30),
];
}
}
|