File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ protected function buildDefinition(Model $model)
79
79
$ faker = $ this ->fakerData ($ column ->name ()) ?? $ this ->fakerDataType ($ column ->dataType ());
80
80
$ definition .= '$faker-> ' . $ faker ;
81
81
$ definition .= ', ' . PHP_EOL ;
82
+
83
+ if ($ column ->dataType () === 'enum ' and !empty ($ column ->attributes ())) {
84
+ $ definition = str_replace ("/** attributes **/ " , json_encode ($ column ->attributes ()), $ definition );
85
+ }
82
86
}
83
87
}
84
88
@@ -143,7 +147,8 @@ protected function fakerDataType(string $type)
143
147
'decimal ' => 'randomFloat() ' ,
144
148
'float ' => 'randomFloat() ' ,
145
149
'longtext ' => 'text ' ,
146
- 'boolean ' => 'boolean '
150
+ 'boolean ' => 'boolean ' ,
151
+ 'enum ' => 'randomElement(/** attributes **/) ' ,
147
152
];
148
153
149
154
return $ fakeableTypes [$ type ] ?? null ;
You can’t perform that action at this time.
0 commit comments