You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`{name}`: The name of the enum class to be created (e.g., OrderStatus). The command will automatically append "Enum" to the name (e.g., OrderStatusEnum).
29
-
*`{enumType}`: The underlying data type for the enum. Can be either int or string (defaults to string if not specified).
30
-
Example Usage:
29
+
*`{type?}`: The underlying data type for the enum. Can be either --int --string or if not specified it will be a pure enum.
30
+
*`{--force}`: Overwrite the enum if it already exists.
31
+
Example Usage:
31
32
32
33
To create an enum named OrderStatusEnum backed by integers:
33
34
34
35
```Bash
35
-
php artisan make:laravel-backed-enum OrderStatus int
36
+
php artisan make:enum OrderStatus --int
36
37
```
37
38
38
-
This will generate an OrderStatusEnum class in the `app/Enums` directory.
39
+
To create an enum named OrderStatusEnum backed by strings:
40
+
41
+
```Bash
42
+
php artisan make:enum OrderStatus --string
43
+
```
44
+
45
+
To create a pure enum named OrderStatusEnum:
46
+
47
+
```Bash
48
+
php artisan make:enum OrderStatus
49
+
50
+
```
51
+
52
+
This will generate an OrderStatusEnums in the `app/Enums` directory.
0 commit comments