File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
src/Console/Commands/LaravelProjectAssist/stubs Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -7,28 +7,28 @@ use HichemtabTech\LaravelProjectAssist\DataClassLikeEnumKeyAndValue;
7
7
class {{class}} extends DataClassLikeEnumKeyAndValue
8
8
{{{fields}}
9
9
10
- public function ALL(): array
10
+ public static function ALL(): array
11
11
{
12
12
return [{{values}}
13
13
];
14
14
}
15
15
16
- public function LABELS(): array
16
+ public static function LABELS(): array
17
17
{
18
18
return array_keys($this->ALL());
19
19
}
20
20
21
- public function VALUES(): array
21
+ public static function VALUES(): array
22
22
{
23
23
return array_values($this->ALL());
24
24
}
25
25
26
- public function getLabelByValue($value): ?string
26
+ public static function getLabelByValue($value): ?string
27
27
{
28
28
return array_search($value, $this->ALL()) OR null;
29
29
}
30
30
31
- public function getValueByLabel($label): ?int
31
+ public static function getValueByLabel($label): ?int
32
32
{
33
33
return $this->ALL()[$label]??null;
34
34
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class {{class}} extends DataClassLikeEnumValueOnly
8
8
{
9
9
{{fields}}
10
10
11
- public function ALL(): array
11
+ public static function ALL(): array
12
12
{
13
13
return [{{values}}
14
14
];
You can’t perform that action at this time.
0 commit comments