nuewire/platform

Laravel admin shell with a global header, contextual navigation, encrypted settings, and Livewire integration.

Maintainers

Package info

github.com/nuewire/platform

pkg:composer/nuewire/platform

Transparency log

Statistics

Installs: 10

Dependents: 0

Suggesters: 8

Stars: 0

Open Issues: 0

2.0.1 2026-07-29 06:28 UTC

This package is auto-updated.

Last update: 2026-07-29 06:34:35 UTC


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.