Version 1.5.5 of the TypeDCMS Starter Kit for Laravel has been released

This release introduces a nice little helper function for retrieving hierarchies.

< 1m read Releases Laravel 📢 Announcements

This release provides a simple helper function on repositories for retrieving hierarchies as a tree of constructs.

Previously you'd call all() specifying the hierarchy, something like this:

$navItems = $navRepo->all(['hierarchy' => 'primary-navigation'])->getData();

And it would then be necessary to restructure these constructs based on the hierarchy meta. Now this is all wrapped up in the new hierarchy() method.

$navItemTree = $navRepo->heirarchy('primary-navigation');

Which outputs Construct models in a tree structure ready for traversal.

[
    'construct' => Construct,
    'children' => [
        [
            'construct' => Construct,
            'children' => [...]
        ],
        ...
    ]
]
Avatar of George Palmer

George Palmer

Co-Founder and CTO

Co-founder and lead developer at typdy.

Partnered with some awesome companies

Honeystone Honeystone Piranhamon Piranhamon