|
2 | 2 | "$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json", |
3 | 3 | "codeGenerations": [ |
4 | 4 | { |
5 | | - "id": "webfox.create-string-backed-enum", |
6 | | - "name": "Create String Backed Enum", |
| 5 | + "id": "webfox.create-backed-enum", |
| 6 | + "name": "Create Backed Enum", |
7 | 7 | "classSuffix": "Enum", |
8 | | - "files": [ |
| 8 | + "parameters": [ |
9 | 9 | { |
10 | | - "appNamespace": "Enums", |
11 | | - "name": "${INPUT_CLASS|className|upperCamelCase}.php", |
12 | | - "template": { |
13 | | - "type": "stub", |
14 | | - "path": "/stubs/laravel-backed-enum.stub", |
15 | | - "fallbackPath": "stubs/laravel-backed-enum.stub", |
16 | | - "parameters": { |
17 | | - "{{ class }}": "${INPUT_CLASS|className|upperCamelCase}", |
18 | | - "{{ namespace }}": "${INPUT_FQN|namespace}", |
19 | | - "{{ value }}": "'standard'", |
20 | | - "{{ type }}": "string" |
21 | | - } |
22 | | - } |
| 10 | + "id": "webfox.create-backed-enum:type", |
| 11 | + "name": "Type", |
| 12 | + "type": "combobox", |
| 13 | + "options": { |
| 14 | + "string": "string", |
| 15 | + "int": "int" |
| 16 | + }, |
| 17 | + "variable": "TYPE" |
23 | 18 | } |
24 | | - ] |
25 | | - }, |
26 | | - { |
27 | | - "id": "webfox.create-int-backed-enum", |
28 | | - "name": "Create Integer Backed Enum", |
29 | | - "classSuffix": "Enum", |
| 19 | + ], |
30 | 20 | "files": [ |
31 | 21 | { |
32 | 22 | "appNamespace": "Enums", |
|
38 | 28 | "parameters": { |
39 | 29 | "{{ class }}": "${INPUT_CLASS|className|upperCamelCase}", |
40 | 30 | "{{ namespace }}": "${INPUT_FQN|namespace}", |
41 | | - "{{ value }}": "0", |
42 | | - "{{ type }}": "int" |
| 31 | + "{{ value }}": "${TYPE|replace:string,'standard'|replace:int,0}", |
| 32 | + "{{ type }}": "${TYPE}" |
43 | 33 | } |
44 | 34 | } |
45 | 35 | } |
|
0 commit comments