MAD
MAD
TCTwill CMS
Created by MAD on 10/18/2024 in #👊support
Position reordering not working
Of course, it's a Laravel collection.. Thanks for that! It wasn't my edits (just started with new data) it was the ->ordered() call. So far so good, I'll experiment around with it some more. Thanks for the awesome work, code and project [AT]twill people!
7 replies
TCTwill CMS
Created by MAD on 10/18/2024 in #👊support
Position reordering not working
The order above is not reflected when retreiving the order like this:
$links = MenuLink::published()->get()->toTree();

$links = $links->map(function(MenuLink $link) { return $link->title; });
dd($links);
$links = MenuLink::published()->get()->toTree();

$links = $links->map(function(MenuLink $link) { return $link->title; });
dd($links);
Actual output:
Illuminate\Support\Collection {#1531 ▼ // app/View/Components/Menu.php:31
#items: array:3 [▼
0 => "Home"
1 => "About"
2 => "Plans"
]
#escapeWhenCastingToString: false
}
Illuminate\Support\Collection {#1531 ▼ // app/View/Components/Menu.php:31
#items: array:3 [▼
0 => "Home"
1 => "About"
2 => "Plans"
]
#escapeWhenCastingToString: false
}
7 replies
TCTwill CMS
Created by MAD on 10/18/2024 in #👊support
Position reordering not working
No description
7 replies