nuewire / platform
Laravel admin shell with a global header, contextual navigation, encrypted settings, and Livewire integration.
Requires
- php: ^8.2
- illuminate/auth: ^11.0|^12.0|^13.0
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/encryption: ^11.0|^12.0|^13.0
- illuminate/filesystem: ^11.0|^12.0|^13.0
- illuminate/routing: ^11.0|^12.0|^13.0
- illuminate/session: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- illuminate/translation: ^11.0|^12.0|^13.0
- illuminate/validation: ^11.0|^12.0|^13.0
- illuminate/view: ^11.0|^12.0|^13.0
- livewire/livewire: ^3.6|^4.0.3
- nuewire/support: ^1.0
- psr/log: ^1.1|^2.0|^3.0
Requires (Dev)
- orchestra/testbench: ^9.0|^10.0|^11.0
- phpunit/phpunit: ^11.0|^12.0
README
Admin shell, contextual navigation, and encrypted general settings for Laravel Livewire packages.
Install
composer require nuewire/platform:^2.0 php artisan optimize:clear
Open /admin. The route prefix and middleware are configured in config/nuewire/platform.php.
Default layout
[Logo] Home Content Plugin Settings [Notification] [Theme] [User]
- Home renders a full-width dashboard without a sidebar.
- Content, Plugin, and Settings render a sidebar for the active area.
- Empty areas and groups are hidden after visibility and permission filtering.
- On mobile, primary navigation and the contextual sidebar move into an off-canvas drawer.
The notification action is rendered only when the host binds Nuewire\Platform\Contracts\NotificationProvider.
Register navigation
Navigation uses three levels:
Area → Group → Page
use Nuewire\Platform\Navigation\NavigationRegistry; app(NavigationRegistry::class) ->registerArea('content', [ 'label' => ['id' => 'Konten', 'en' => 'Content'], 'order' => 20, ]) ->registerGroup('content', 'publishing', [ 'label' => ['id' => 'Publikasi', 'en' => 'Publishing'], 'order' => 10, ]) ->register('blog.posts', [ 'area' => 'content', 'group' => 'publishing', 'slug' => 'posts', 'label' => ['id' => 'Artikel', 'en' => 'Posts'], 'description' => ['id' => 'Kelola artikel.', 'en' => 'Manage posts.'], 'component' => 'blog::posts', 'permission' => 'posts.view', 'icon' => 'content', 'order' => 10, ]);
Page IDs should be namespaced, such as blog.posts, while URL slugs remain short. The optional aliases field supports redirects from old slugs.
Available conditional fields:
'visible' => fn (): bool => config('blog.enabled'), 'badge' => fn (): ?string => '3',
permission controls authorization. visible controls feature availability; it must not be used as a substitute for authorization.
Routes
/admin
/admin/content/{page}
/admin/plugin/{page}
/admin/settings/{page}
When a page is requested through an alias or the wrong legacy area, Platform redirects to its canonical URL.
Layouts
<x-nuewire::admin title="Dashboard" :full-width="true"> ... </x-nuewire::admin> <x-nuewire::admin title="Posts" active-area="content" active-page="blog.posts" > ... </x-nuewire::admin> <x-nuewire::guest title="Login"> ... login form ... </x-nuewire::guest>
The guest layout only renders the login UI. The host application keeps control of authentication.
Theme and settings
The header theme control cycles through System, Light, and Dark. The selected mode is a personal browser preference stored under nuewire.theme. General Settings only defines the default used before the user chooses a mode.
<livewire:nuewire-platform />
Settings are encrypted at storage/app/private/.nuewire/platform.json. Version 2 reads the old theme key and migrates it to default_theme. The v1 navigation and sidebar_mode values are ignored because the new shell has a fixed header and contextual sidebar.
User menu
The profile and logout route names are configurable:
'user_menu' => [ 'profile_route' => 'profile.edit', 'logout_route' => 'logout', ],
Missing routes are not rendered.
Publish
php artisan vendor:publish --tag=nuewire-platform-config php artisan vendor:publish --tag=nuewire-platform-views php artisan vendor:publish --tag=nuewire-platform-translations
See the suite migration guide at docs/NAVIGATION_V2.md.