TypedCMS is currently in Early Access. To start using TypedCMS now, please register for our Early Access Program.

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' => [...]
        ],
        ...
    ]
]

Share this post

Laravel Starter Kit Guide

Starter Kit

TypedCMS' use of JSON:API specification compliant APIs make it really easy to integrate into any new or existing Laravel project.

The TypedCMS Starter Kit for Laravel is the perfect kick start to your implementation, whether for an existing project or brand new one. Our stater kits are tailored solutions for each platform, unlike the simple API wrappers offered by other vendors.

Our Laravel kit provides Eloquent like models, repositories, query caching and a simple mechanism for adding custom webhook controllers and handlers.