Appearance
Admin Menu
Arrange the admin menu from the admin itself: reorder, move, rename, hide, set icons, restrict who sees what, and add sections and links of your own.
kitloom/ · admins: kitloom/, kitloom/
The admin menu is not fixed by the packages that build it: an administrator arranges it from the admin itself, and the edits apply on top of whatever the application and the modules put there — in Filament and in Nova alike, from one table.
What an administrator can do
| Filament, Tools → Admin Menu | Nova, / | |
|---|---|---|
| Reorder sections and the entries inside them | drag | drag |
| Move an entry into another section | a Section select on the entry | drag it there |
| Nest entries — an entry under another | — | drag it inside |
| Rename a section or an entry | the Section / Label field | the label field |
| Set an icon on an entry | a Heroicon name, heroicon- | a Heroicon name, squares- |
| Hide a section or an entry | the Hidden switch | hide |
| Restrict who sees it | Who sees it: permissions, any one of them is enough | the same |
| Add your own sections, groups and links — to a page of the admin, or any URL | — | Add section, Add link; your own ones can be deleted again |
| Reset to what the packages build | Reset | reset |
Everything else keeps working as before: an entry you hide is only out of the menu, the page behind it still opens by its address and still asks its own permission. An entry restricted to permissions is shown to a user who holds any one of them; a section hidden or restricted takes its entries with it.
What nobody has placed yet — the section of a module installed later — goes after the placed entries (kitloom-) until someone drags it where it belongs. Both screens are for those who may manage_.
The edits are per admin: the Filament menu and the Nova menu are arranged separately, in the same table, so a site that runs both keeps two layouts.
What is inside
| What | Where |
|---|---|
| Edits | table menu_ (the site's table prefix in front): a row per entry, per admin (filament, nova) |
| Reading | Kitloom\ — all($admin), find($admin, $key), as Menu value objects: parent, sort, label, icon, hidden, permissions, custom |
| Writing | Kitloom\ — replace, put, forget, clear, with the acting user; visible |
| Configuration | config/ |
A site arranges its menu once, in a migration, the way the Nova skeleton puts the sidebar in WordPress order — Dashboard, Posts, Media, Pages, Comments, Appearance, Modules, Users, Tools, Settings — and administrators change it from there:
php
use Kitloom\AdminMenu\Contracts\MenuOverrides;
use Kitloom\AdminMenu\MenuEditor;
// A migration arranging the menu — the system, nobody is asked.
app(MenuEditor::class)->put(MenuOverrides::NOVA, 'App\Nova\Tools\Posts', ['sort' => 1400]);
// A user: `manage_options` is asked of them, AuthorizationException otherwise.
app(MenuEditor::class)->replace(MenuOverrides::FILAMENT, $overrides, $request->user());
// Who sees an entry restricted to permissions: any one of them is enough.
app(MenuEditor::class)->visibleTo(['edit_posts', 'manage_options'], $user);An entry is named the way its admin recognises it across requests: Filament by group: and item:, Nova by the class behind the entry, then menu_, then menu_; menu_ is an entry the admin added themselves (custom holds its type and path).
Coming from the earlier packages
The migration creates menu_ and copies the rows of filament_ and nova_ when those tables are there; the old tables are left for the site to drop.
What the application overrides
- Storage:
kitloom-, an implementation ofadmin- menu. repository Menu;Overrides Arrayis there for tests and a menu described in configuration.Menu Overrides - The screens:
kitloom-andadmin- menu. filament. register kitloom-turn them off (admin- menu. nova. register php artisan vendor:); the saved menu still applies. In Filament,publish -- tag=kitloom- admin- menu- config kitloom-(admin- menu. filament. navigation_ group Tools) andnavigation_move the screen. An application with asort Nova::callback of its own callsmain Menu Adminfrom inside it and listsMenu:: sort($menu, $request) Adminamong its tools.Menu Tool
Tests
From the application that installs the package: php vendor/.