File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -280,17 +280,17 @@ protected static function getParentFormComponent()
280280 ->validationAttribute (__ ('inspirecms::resources/navigation.parent_id.validation_attribute ' ))
281281 ->options (function ($ record , $ get ) {
282282 $ keyName = app (static ::getModel ())->getKeyName ();
283-
283+
284284 $ traverse = function ($ categories , $ prefix = '- ' ) use (&$ traverse , $ keyName ) {
285285 return collect ($ categories )->map (function ($ category ) use ($ traverse , $ prefix , $ keyName ) {
286- $ label = $ prefix. ' ' . $ category ->title ;
286+ $ label = $ prefix . ' ' . $ category ->title ;
287287
288288 $ key = $ category ->{$ keyName };
289289
290- $ children = $ traverse ($ category ->children , $ prefix. '- ' );
290+ $ children = $ traverse ($ category ->children , $ prefix . '- ' );
291291
292292 return [
293- 'label ' => $ label ,
293+ 'label ' => $ label ,
294294 'value ' => $ key ,
295295 'children ' => $ children ,
296296 ];
@@ -308,14 +308,15 @@ protected static function getParentFormComponent()
308308 $ tmpOpts = collect ($ traverse ($ records ))
309309 ->flatten ()
310310 // even = labels, odd = values
311- ->reduce (function ($ carry , $ item , $ index ) {
311+ ->reduce (function ($ carry , $ item , $ index ) {
312312 $ carry ??= [];
313313 // array<0> = labels, array<1> = values
314314 if ($ index % 2 === 0 ) {
315315 $ carry [0 ][] = $ item ;
316316 } else {
317317 $ carry [1 ][] = $ item ;
318318 }
319+
319320 return $ carry ;
320321 }, []);
321322
You can’t perform that action at this time.
0 commit comments