File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
app/Livewire/Project/Service Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public function mount()
33
33
$ key = data_get ($ field , 'key ' );
34
34
$ value = data_get ($ field , 'value ' );
35
35
$ rules = data_get ($ field , 'rules ' , 'nullable ' );
36
- $ isPassword = data_get ($ field , 'isPassword ' );
36
+ $ isPassword = data_get ($ field , 'isPassword ' , false );
37
37
$ this ->fields ->put ($ key , [
38
38
'serviceName ' => $ serviceName ,
39
39
'key ' => $ key ,
@@ -47,7 +47,15 @@ public function mount()
47
47
$ this ->validationAttributes ["fields. $ key.value " ] = $ fieldKey ;
48
48
}
49
49
}
50
- $ this ->fields = $ this ->fields ->sortBy ('name ' );
50
+ $ this ->fields = $ this ->fields ->groupBy ('serviceName ' )->map (function ($ group ) {
51
+ return $ group ->sortBy (function ($ field ) {
52
+ return data_get ($ field , 'isPassword ' ) ? 1 : 0 ;
53
+ })->mapWithKeys (function ($ field ) {
54
+ return [$ field ['key ' ] => $ field ];
55
+ });
56
+ })->flatMap (function ($ group ) {
57
+ return $ group ;
58
+ });
51
59
}
52
60
53
61
public function saveCompose ($ raw )
You can’t perform that action at this time.
0 commit comments