Courses

Filament 3 From Scratch: Practical Course

Menu Items: Ordering, Grouping, Icons, Badges

You're reading a FREE PREVIEW of a PREMIUM course.
Summary of this lesson:
- Configuring top vs side navigation
- Ordering and grouping menu items
- Customizing menu icons
- Adding badges to menu items

For now, in this course, we've been generating Filament Resources with menu items being auto-generated for us. They have the same icon and a pretty random order. In this lesson, let's learn how to customize it all.


Menu: Left or Top?

So, for now, we have this view in the left menu:

First quick change: did you know we can easily change the menu from the left to the top? It's configurable by adding topNavigation() in the main AdminPanelProvider:

app/Providers/Filament/AdminPanelProvider.php:

public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
->login()
->registration()
->topNavigation()

With this simple change, the menu looks like this:


Ordering Menu Items

Next, if you don't specify any order for menu items, they are ordered alphabetically.

To change that, add an integer property $navigationSort in each Filament Resource, representing their order position.

For example, I want to sort the menu items in the order they would be used: from the most often (Orders) to the...

The full lesson is only for Premium Members.
Want to access all 24 lessons of this course? (101 min read)

You also get:

  • 76 courses
  • Premium tutorials
  • Access to repositories
  • Private Discord