Skip to main content
Navigation items are the building blocks of the application sidebar. You compose them in your AppLayout class — see Layout for how to wire them into the navigation areas. NavigationItem represents a single navigation link. Pass the route name and display label to make().
use Inly\Core\Layouts\NavigationItem;

NavigationItem::make('users.index', __('Users'))
    ->icon('Users')

Icons

Icons use Lucide icon names:
NavigationItem::make('dashboard', __('Dashboard'))
    ->icon('LayoutDashboard')

Route Parameters

Pass route parameters as the third argument to make(), or use the params() method:
// Preferred: pass params in the constructor
NavigationItem::make('users.show', __('Overview'), ['user' => $user])
    ->icon('User')

// Alternative: use the params() method
NavigationItem::make('users.show', __('Overview'))
    ->params(['user' => $user])
    ->icon('User')

From Domain Object

When your models implement DomainObjectContract, you can build navigation items from the class (index/collection page) or an instance (show page). Title, icon, URL, and visibility are derived from the contract; when the URL is null (e.g. no permission), the item is hidden. Collection (index): pass the class. The item uses the collection title and getDomainObjectCollectionUrl(). If that URL is null, the item is hidden.
use App\Models\School;
use Inly\Core\Layouts\NavigationItem;

NavigationItem::fromDomainObject(School::class)
Show: pass an instance. The item uses the object title, icon, and getObjectUrl(). If the URL is null, the item is hidden.
NavigationItem::fromDomainObject($school)
You can override any value by chaining methods after fromDomainObject():
NavigationItem::fromDomainObject(School::class)
    ->icon('Building')
    ->title(__('All schools'))

NavigationItem::fromDomainObject($school)
    ->title($school->name . ' — ' . __('Overview'))
The URL is matched against your Laravel routes to get the route name and parameters. If the URL does not match a route, the item uses a direct href and active state is determined by comparing the current request URL.
For implementing the contract on your models, see Object model.

Badges

Badges display counters or status indicators next to the item label:
use Inly\Core\Enums\CoreVariant;

NavigationItem::make('notifications', __('Notifications'))
    ->icon('Bell')
    ->badge(value: $unreadCount, variant: CoreVariant::DESTRUCTIVE)
Available badge variants: DEFAULT, SECONDARY, DESTRUCTIVE, OUTLINE, SUCCESS, WARNING, and INFO.

Conditional Visibility

Hide items based on permissions or conditions using a boolean or closure:
NavigationItem::make('admin.index', __('Admin'))
    ->icon('ShieldCheck')
    ->hidden(fn () => ! user()->can('access-admin'))

Auto-Hide When Empty

Use hiddenIfNoItems() on a parent item to hide it automatically when all of its sub-items are hidden:
NavigationItem::make('settings', __('Settings'))
    ->icon('Settings')
    ->hiddenIfNoItems()
    ->items([
        NavigationItem::make('admin.users', __('Users'))
            ->hidden(fn () => ! user()->can('manage-users')),
    ])
If the user lacks manage-users, the Settings parent item will also disappear.

Sub-Items

Create one level of nested navigation:
NavigationItem::make('settings', __('Settings'))
    ->icon('Settings')
    ->items([
        NavigationItem::make('settings.profile', __('Profile'))->icon('User'),
        NavigationItem::make('settings.security', __('Security'))->icon('Lock'),
    ])
The sidebar supports only one level of sub-items. Avoid deeper nesting.

Disabled Items

Disable an item to keep it visible but non-interactive:
NavigationItem::make('beta.feature', __('Beta Feature'))
    ->icon('Sparkles')
    ->disabled()

// Conditional disabling
NavigationItem::make('premium.feature', __('Premium Feature'))
    ->icon('Crown')
    ->disabled(fn () => ! user()->hasActivePremiumSubscription())
Disabled items render with reduced opacity and a not-allowed cursor.

NavigationSection groups related items under a labeled, collapsible accordion with an optional colored icon.
use Inly\Core\Layouts\NavigationSection;

NavigationSection::make(__('Sales'), [
    NavigationItem::make('deals.index', __('Deals'))->icon('Handshake'),
    NavigationItem::make('contacts.index', __('Contacts'))->icon('Users'),
])
->icon('TrendingUp')
->color(220)

Icon and Color

The section icon renders as a small rounded square. Set the color using an HSL hue value (0–360):
NavigationSection::make(__('Operations'), [
    // items...
])
->icon('Boxes')
->color(150) // Green
Common hue values: Red (0), Orange (30), Yellow (60), Green (120), Cyan (180), Blue (220), Purple (280), Pink (330).

Collapsible Behavior

Sections are collapsible by default. The expanded/collapsed state is persisted in localStorage per section, so the user’s preference survives page reloads.

Auto-Hide Empty Sections

If all items in a section are hidden, the section itself is hidden automatically — no extra configuration needed.
NavigationSecondaryItem creates external links that appear in the sidebar footer.
use Inly\Core\Layouts\NavigationSecondaryItem;

NavigationSecondaryItem::make(__('Documentation'), 'https://docs.example.com')
    ->icon('BookOpen')
Secondary items open in a new tab by default and support hidden() for conditional visibility.

Method Reference

MethodParametersDescription
make()string $name, string $title, array $params = []Create a navigation item
fromDomainObject()DomainObjectContract|class-string<DomainObjectContract> $classOrInstanceCreate from domain object (index or show); hidden when URL is null
title()string $titleOverride the display title (chainable)
href()string $urlUse a direct URL instead of route name and params
icon()string $iconLucide icon name
params()array $paramsRoute parameters
badge()mixed $value, CoreVariant $variantAdd a badge
items()NavigationItem[] $itemsAdd sub-items
hidden()Closure|bool $conditionHide based on condition
hiddenIfNoItems()Auto-hide when all sub-items are hidden
disabled()Closure|bool $condition = trueMake non-clickable
MethodParametersDescription
make()string $title, NavigationItem[] $itemsCreate a section
icon()string $iconLucide icon name
color()int $hueHSL hue value (0–360)
MethodParametersDescription
make()string $title, string $urlCreate an external link
icon()string $iconLucide icon name
hidden()Closure|bool $conditionHide based on condition