-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCatFactory.php
More file actions
76 lines (68 loc) · 1.5 KB
/
CatFactory.php
File metadata and controls
76 lines (68 loc) · 1.5 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
namespace Workbench\Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Workbench\App\Models\Cat;
/**
* @template TModel of \Workbench\App\Models\Cat
*
* @extends Factory<TModel>
*/
class CatFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var class-string<TModel>
*/
protected $model = Cat::class;
protected $names = [
'Whiskers',
'Mittens',
'Shadow',
'Simba',
'Luna',
'Oliver',
'Bella',
'Charlie',
'Lucy',
'Max',
];
protected $breeds = [
'Siamese',
'Persian',
'Maine Coon',
'Bengal',
'British Shorthair',
'Ragdoll',
'Sphynx',
'Norwegian Forest',
'Scottish Fold',
'Abyssinian',
];
protected $fluffyness = [
'superfluffy',
'fluffy',
'not-fluffy',
];
protected $color = [
'black',
'white',
'gray',
'orange',
'brown',
];
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => $this->faker->randomElement($this->names),
'breed' => $this->faker->randomElement($this->breeds),
'fluffyness' => $this->faker->randomElement($this->fluffyness),
'color' => $this->faker->randomElement($this->color),
];
}
}