Skip to content

Commit ada774b

Browse files
committed
Update readme
1 parent 299be5a commit ada774b

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,36 @@ Conveniently create a new backed enum using the make command.
2020
#### Command:
2121

2222
```Bash
23-
php artisan make:laravel-backed-enum {name} {enumType}
23+
php artisan make:enum {name} {type?}
2424
```
2525

2626
#### Arguments:
2727

2828
* `{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:
3132

3233
To create an enum named OrderStatusEnum backed by integers:
3334

3435
``` Bash
35-
php artisan make:laravel-backed-enum OrderStatus int
36+
php artisan make:enum OrderStatus --int
3637
```
3738

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.
3953

4054
### Setup your enum
4155

0 commit comments

Comments
 (0)