---
title: Navigation
published: 2026-10-14
lastmod: 2026-10-17
url: https://larasell.dev/docs/admin/reference/navigation
---

## Table of contents
- [Adding items](#adding-items)
  - [Adding table pages](#adding-table-pages)
- [Positioning items](#positioning-items)
- [Placing items relatively](#placing-items-relatively)
- [Nesting items](#nesting-items)

# Navigation

Larasell allows you to add items to the sidebar navigation of the admin panel.

## Adding items

First, create a `routes/admin.php` file, if it does not exist.

Use the `Navigation`{href="https://raw.githubusercontent.com/Larasell-dev/admin/refs/heads/main/src/Facades/Navigation.php"} facade inside `routes/admin.php` to add an item to the sidebar. Each item needs a label, a route and an icon. The icon is an `Icon`{href="https://raw.githubusercontent.com/Larasell-dev/admin/refs/heads/main/src/Enums/Icon.php"} enum case or a [Remix icon](https://remixicon.com) name such as `'sticky-note'`:

```php
use Larasell\Admin\Enums\Icon;
use Larasell\Admin\Facades\Navigation;

Route::get('notes', NotesController::class)->name('notes');

Navigation::add('Notes', 'larasell.admin.notes', Icon::StickyNote);
```

The route group inside `routes/admin.php` prefixes route names with
`larasell.admin.`, so `notes` becomes `larasell.admin.notes`. Pass the full
route name to the facade.

### Adding table pages

When an item links to a [table](/docs/admin/reference/tables), you can register the route and
the item in one call with the `index` method instead:

```php
use App\Tables\ProductReviewTable;
use Larasell\Admin\Enums\Icon;
use Larasell\Admin\Facades\Navigation;

Navigation::index(
    'Reviews',
    'reviews',
    ProductReviewTable::class,
    Icon::Star,
);
```

It takes a label, a URI, the table class and an icon. It does the same as:

```php
Route::index('reviews', ProductReviewTable::class);

Navigation::add('Reviews', 'larasell.admin.reviews.index', Icon::Star);
```

The route is named after the URI, so `reviews` becomes `larasell.admin.reviews.index`.
Use that name to place other items before or after it.

## Positioning items

By default, the panel appends items to the bottom of the navigation.
To control where an item appears, set an explicit position using the `position` method:

```php
Navigation::add('Notes', 'larasell.admin.notes', Icon::StickyNote)->position(500);
```

The panel sorts items by position in ascending order.

## Placing items relatively

Instead of setting a numeric position, you can place an item before or after an existing one. The
target can be the id of an existing item or a `NavItem`{href="https://raw.githubusercontent.com/Larasell-dev/admin/refs/heads/main/src/Enums/NavItem.php"} enum case:

```php
use Larasell\Admin\Enums\Icon;
use Larasell\Admin\Enums\NavItem;
use Larasell\Admin\Facades\Navigation;

Navigation::add('Notes', 'larasell.admin.notes', Icon::StickyNote)->before('larasell.admin.home');
Navigation::add('Reports', 'larasell.admin.reports', Icon::FileChart)->after(NavItem::Home);
```

`NavItem`{href="https://raw.githubusercontent.com/Larasell-dev/admin/refs/heads/main/src/Enums/NavItem.php"} has a case for each built-in item: `Home`, `Products`, `Categories`, `Orders`,
`Customers` and `Settings`.

## Nesting items

Group related pages by nesting them under another item. Use the `children`{href="https://raw.githubusercontent.com/Larasell-dev/admin/refs/heads/main/src/ValueObjects/NavigationItem.php"} method to add
items under the one you just added:

```php
use App\Tables\ProductReviewTable;
use Larasell\Admin\Enums\Icon;
use Larasell\Admin\Facades\Navigation;
use Larasell\Admin\NavigationGroup;

Navigation::add('Notes', 'larasell.admin.notes', Icon::StickyNote)
    ->children(function (NavigationGroup $notes) {
        $notes->add('Reports', 'larasell.admin.reports', Icon::FileChart);

        $notes->index(
            'Reviews',
            'reviews',
            ProductReviewTable::class,
            Icon::Star,
        );
    });
```

The group has the same `add` and `index` methods as the `Navigation`{href="https://raw.githubusercontent.com/Larasell-dev/admin/refs/heads/main/src/Facades/Navigation.php"} facade.

To nest an item under an item you didn't add, like a built-in one, use the `under` method. It
takes the id of the parent or a `NavItem`{href="https://raw.githubusercontent.com/Larasell-dev/admin/refs/heads/main/src/Enums/NavItem.php"} case:

```php
use Larasell\Admin\Enums\Icon;
use Larasell\Admin\Enums\NavItem;
use Larasell\Admin\Facades\Navigation;

Navigation::add('Team', 'larasell.admin.team', Icon::Group)
    ->under(NavItem::Settings);
```

Items nest one level deep, so the parent must be a top-level item.

`position`, `before` and `after` work on nested items too, but they only order an item among
the other children of the same parent.
