presta/sonata-navigation-bundle
The Presta Sonata Navigation Bundle integrates configurable navigation menus with Sonata Admin, enabling developers to create, organize, and render hierarchical menus in Symfony applications through an admin-friendly workflow.
Reality check first. presta/sonata-navigation-bundle is not a Laravel package — it is a Symfony 2.x bundle built to extend SonataAdminBundle's sidebar/navigation (custom actions, role-gated items, translated labels, descriptions). It was last released in January 2014, is archived, has one star and zero dependents. There is no path to composer require-ing this into a Laravel app: it depends on Symfony 2.x components, Twig 1.x, and SonataAdminBundle ~2.x, none of which resolve against a modern Laravel composer.json.
So the "getting started" step for a Laravel developer is a decision:
presta_sonata_navigation config tree) and its Twig template that overrides Sonata's navigation block. That pair is the whole package: config in, menu rendered out.AppKernel, import its routing (if any), and add a presta_sonata_navigation: block to config.yml defining entries with a label, route, role, and description.ROLE_ADMIN (or a Gate ability), carries a __('admin.reports') label, and shows a description as a title tooltip. That is exactly the behaviour this bundle provided for Sonata.The bundle's day-to-day value is a small set of patterns. Map each to Laravel equivalents:
config/navigation.php returning an array of entries (label, route, ability, description, icon, order). Keep the definition declarative so product owners can add items without touching Blade.Gate::allows($entry['ability']) (policies are cleaner than raw role string comparison, and you avoid drift between menu visibility and controller authorization).__('navigation.reports.label') and __('navigation.reports.description') and keep keys in lang/{locale}/navigation.php so missing translations are obvious.<x-admin.sidebar :items="$menu" />) plus a view composer or a small NavigationServiceProvider that builds and caches the resolved entry list for the request. Register it as a singleton so the filtering happens once per request, not per item per render.NavigationItem value object with an optional action closure or route array, so an item can be a link, a POST form, or an external URL without special-casing in the template.order → pass to the layout (view composer on layouts.admin) → assert with a feature test that a non-admin sees fewer items. A test like actingAs($user)->get('/admin')->assertDontSee('Reports') is the cheapest guard against menu/authorization drift.config/navigation.php keys against the loaded translator and fails loudly on missing entries.can:. Pick one and enforce it consistently, otherwise a hidden menu item can still be reachable by URL.php artisan config:clear (and route:clear if you reference new route names) before you will see them. Do not cache the resolved menu longer than the request unless you tag and invalidate it.config:cache) can behave differently with nested arrays — use an explicit order integer rather than relying on array position.dd($menu) in the view composer, or Log::debug(['menu' => $menu->toArray()]), before the component renders. Most "item missing" bugs are an ability check or a route-name typo, not a rendering issue.~5.3|~5.4, Symfony ~2.3, and SonataAdmin ~2.2; add at least a smoke test that the container compiles with the navigation config loaded; document that the bundle is archived upstream so nobody files issues against the original.How can I help you explore Laravel packages today?