PHPackages                             moonshine/multi-panels - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. moonshine/multi-panels

ActiveLibrary[Admin Panels](/categories/admin)

moonshine/multi-panels
======================

Multi panels for MoonShine

0.1.0(4mo ago)420MITPHPPHP ^8.2CI passing

Since Jan 8Pushed 4mo agoCompare

[ Source](https://github.com/moonshine-software/multi-panels)[ Packagist](https://packagist.org/packages/moonshine/multi-panels)[ Docs](https://getmoonshine.app)[ RSS](/packages/moonshine-multi-panels/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/9b2486ab0fd5c39c76025a00ada1f20cc1a284595060421d3724bc968a59b255/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f6f6e7368696e652f6d756c74692d70616e656c73)](https://packagist.org/packages/moonshine/multi-panels)[![Latest Stable Version](https://camo.githubusercontent.com/b280cfd9e9b2e32811badfb4e3a5325bc9371cd70fb5fa2b0a6667bdbee2081b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6f6e7368696e652f6d756c74692d70616e656c73)](https://packagist.org/packages/moonshine/multi-panels)[![License](https://camo.githubusercontent.com/84dcbe957acfbe2809583a0c02da5246f60594d4027fa905e8fbf6b01653a7ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6f6f6e7368696e652f6d756c74692d70616e656c73)](https://packagist.org/packages/moonshine/multi-panels)

 [![Laravel 10+](https://camo.githubusercontent.com/67ff25342790de50f83c6313acb28d5fdd1d7931a63bf481f21ea769b7b1ca1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302b2d4646324432303f7374796c653d666f722d7468652d6261646765266c6f676f3d6c61726176656c)](https://laravel.com) [![PHP 8.2+](https://camo.githubusercontent.com/233addbd8bc6c491cd7a929fd0305ab4d0144a078f8f346dfeb9421d929ac128/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d3737374242343f7374796c653d666f722d7468652d6261646765266c6f676f3d706870)](https://laravel.com)

MoonShine Multi-Panels
======================

[](#moonshine-multi-panels)

> **⚠️ EXPERIMENTAL BETA VERSION**
>
> This package is under active development. API may change in future versions.

Package for creating multiple admin panels in one MoonShine application with independent settings, routes and interfaces.

Requirements
------------

[](#requirements)

- MoonShine 4.4+
- Laravel 10+
- PHP 8.2+

Installation
------------

[](#installation)

```
composer require moonshine/multi-panels
```

Configuration
-------------

[](#configuration)

### 1. Disable default MoonShine routes

[](#1-disable-default-moonshine-routes)

Open `config/moonshine.php` and set:

```
'use_routes' => false,
```

### 2. Add MultiPanelMiddleware

[](#2-add-multipanelmiddleware)

**IMPORTANT:** Add `MultiPanelMiddleware` to the middleware configuration. You can add it at the top-level (for all panels) or to specific panels.

#### Option 1: Add to all panels (recommended)

[](#option-1-add-to-all-panels-recommended)

```
// config/moonshine.php
'middleware' => [
    // ... other middleware
    \MoonShine\MultiPanels\Http\Middleware\MultiPanelMiddleware::class,
],
```

#### Option 2: Add to specific panels only

[](#option-2-add-to-specific-panels-only)

```
// config/moonshine.php
'panels' => [
    'admin' => [
        'prefix' => 'admin',
        'middleware' => [
            'moonshine',
            \MoonShine\MultiPanels\Http\Middleware\MultiPanelMiddleware::class,
        ],
    ],
    'test' => [
        'prefix' => 'test',
        'middleware' => [
            'moonshine',
            \MoonShine\MultiPanels\Http\Middleware\MultiPanelMiddleware::class,
        ],
    ],
],
```

### 3. Configure panels

[](#3-configure-panels)

In the same `config/moonshine.php` file add `panels` section:

```
'panels' => [
    'admin' => [
        'prefix' => '',
        'title' => 'Admin panel',
    ],
    'test' => [
        'prefix' => 'test',
        'title' => 'Test panel',
        'palette' => SkyPalette::class,
        // 'layout' => AppLayout::class,
    ],
],
```

### Panel configuration structure

[](#panel-configuration-structure)

Each panel is a key in the `panels` array, where:

- **Key** - unique panel identifier (e.g., `admin`, `test`)
- **Value** - array of panel settings

#### Available panel settings

[](#available-panel-settings)

Inside a panel you can override **any parameter** from the top-level MoonShine configuration:

```
'panels' => [
    'admin' => [
        'prefix' => '',                    // URL prefix (optional)
        'title' => 'Admin Panel',          // Panel title
        'layout' => AdminLayout::class,    // Custom layout
        'palette' => BluePalette::class,   // Color scheme
        'logo' => '/images/admin-logo.png',
        'logo_small' => '/images/admin-logo-small.png',
        // ... any other settings from moonshine.php
    ],
    'client' => [
        'prefix' => 'client',
        'title' => 'Client Area',
        'layout' => ClientLayout::class,
        'palette' => GreenPalette::class,
        // ... settings for client panel
    ],
],
```

**Important:**

- If a parameter is not specified in the panel, the default value from the top-level configuration is used
- If `prefix` is not specified, the panel key is used as the prefix
- You can set `prefix => ''` for a panel without prefix (root URL)

Usage
-----

[](#usage)

### Binding resources to a panel

[](#binding-resources-to-a-panel)

To make a resource appear only in a specific panel, extend `MultiPanelResource` and specify the `$panel` property:

```
