Commit ae6957f 1 parent 74aca54 commit ae6957f Copy full SHA for ae6957f
File tree 1 file changed +7
-9
lines changed
src/View/Components/Fields
1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ public function __construct(
50
50
default: $ default
51
51
);
52
52
53
- if (!$ this ->endpoints ) {
54
- $ endpointsFromModules = isset ( $ this ->modules ) ? collect ($ this ->modules )->map (function ($ module ) {
53
+ if (!$ this ->endpoints && isset ( $ this -> modules ) ) {
54
+ $ this ->endpoints = collect ($ this ->modules )->map (function ($ module ) {
55
55
return [
56
56
'label ' => $ module ['label ' ] ?? ucfirst ($ module ['name ' ]),
57
57
'value ' => moduleRoute (
@@ -62,16 +62,14 @@ public function __construct(
62
62
false
63
63
),
64
64
];
65
- })->toArray () : null ;
65
+ })->toArray ();
66
66
}
67
67
68
- $ this ->endpoints = $ this ->endpoints === [] ? $ endpointsFromModules ?? [] : [];
69
-
70
68
if (empty ($ this ->endpoints )) {
71
- $ routeEndpoint = $ this ->moduleName ;
72
- if ($ this ->routePrefix ) {
73
- $ routeEndpoint = Str:: replaceFirst ( $ this -> routePrefix . ' . ' , '' , $ this ->moduleName ) ;
74
- }
69
+ $ routeEndpoint = $ this ->routePrefix
70
+ ? Str:: replaceFirst ($ this ->routePrefix . ' . ' , '' , $ this -> moduleName )
71
+ : $ this ->moduleName ;
72
+
75
73
$ this ->endpoint = $ this ->endpoint ?? (empty ($ endpoints ) ? moduleRoute (
76
74
// Remove the route prefix from the moduleName.
77
75
$ routeEndpoint ,
You can’t perform that action at this time.
0 commit comments