PHPackages                             mb4it/moonshine-pages - 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. mb4it/moonshine-pages

ActiveLibrary[Admin Panels](/categories/admin)

mb4it/moonshine-pages
=====================

MoonShine pages and menu package

1.0.9(1mo ago)6133↑30%MITPHPPHP ^8.2

Since May 21Pushed 1w agoCompare

[ Source](https://github.com/Dictator90/mb-moonshine-pages)[ Packagist](https://packagist.org/packages/mb4it/moonshine-pages)[ RSS](/packages/mb4it-moonshine-pages/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (22)Versions (4)Used By (0)

mb4it/moonshine-pages
=====================

[](#mb4itmoonshine-pages)

MoonShine package for managing pages and navigation menus in Laravel applications.

Features
--------

[](#features)

- MoonShine resources for Pages, Menu positions, and Menu items
- Public page route with configurable prefix (`/{slug}` or `/prefix/{slug}`)
- Configurable model, resource, and controller classes
- Menu items support three source types: direct link, page, or named route
- Dynamic route parameters — placeholders detected from the route URI and saved as JSON
- Optional image per menu item
- `menu($code)` helper returns a cached nested tree for frontend rendering
- Package view fallback for page rendering
- Reserved-slug protection — prevents the admin prefix from matching the page route
- Localization: `en`, `ru`

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

[](#requirements)

- PHP 8.2+
- Laravel 12+
- moonshine/moonshine 4.8+

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

[](#installation)

```
composer require mb4it/moonshine-pages
```

Run migrations:

```
php artisan migrate
```

Publish config, migrations, views, and/or translations as needed:

```
php artisan vendor:publish --tag=moonshine-pages-config
php artisan vendor:publish --tag=moonshine-pages-migrations
php artisan vendor:publish --tag=moonshine-pages-views
php artisan vendor:publish --tag=moonshine-pages-lang
```

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

[](#configuration)

Main config file: `config/moonshine-pages.php`

### Route

[](#route)

```
'register_page_route' => true,

'route' => [
    'route_prefix'        => '',           // '' → /{slug}, 'landings' → /landings/{slug}
    'name'                => 'page.show',
    'slug_pattern'        => '^[A-Za-z0-9-_]+$',
    'apply_reserved_slugs' => true,        // exclude admin prefix from slug matches
    'reserved_slugs'      => null,         // null = derive from moonshine.prefix
],
```

### Models

[](#models)

Override Eloquent model classes without subclassing the service provider:

```
'models' => [
    'page'          => \App\Models\Page::class,
    'menu'          => \App\Models\Menu::class,
    'menu_position' => \App\Models\MenuPosition::class,
],
```

### Resources

[](#resources)

Override MoonShine resource classes:

```
'resources' => [
    'menu'          => \App\MoonShine\Resources\MenuResource::class,
    'menu_position' => \App\MoonShine\Resources\MenuPositionResource::class,
    'page'          => \App\MoonShine\Resources\PageResource::class,
],
```

### Tables

[](#tables)

Override database table names (publish and edit migrations before first `migrate`):

```
'tables' => [
    'pages'              => 'pages',
    'menus'              => 'menus',
    'menu_positions'     => 'menu_positions',
    'menu_menu_position' => 'menu_menu_position',
],
```

### Controllers

[](#controllers)

```
'controllers' => [
    'page_show' => \App\Http\Controllers\PageShowController::class,
],
```

### Media

[](#media)

```
'media' => [
    'disk'      => null,    // null = inherit moonshine.disk
    'image_dir' => 'menu',  // upload directory for menu images
],
```

### MoonShine menu

[](#moonshine-menu)

```
'moonshine' => [
    'register_menu_items' => true, // set false when building a custom layout
],
```

Menu source types
-----------------

[](#menu-source-types)

Each menu item has a `source_type` that controls URL generation:

`source_type`Behaviour`link`Raw URL stored in `source_value`.`page`Resolved via the configured page route name; falls back to `#` if the page is inactive.`route``route($source_value, $route_params)`; falls back to `#` on failure.When `source_type = route` the admin form detects URI placeholders (e.g. `{slug}`, `{id}`) in the selected route and renders a text field for each one. Values are saved in `menus.route_params` (JSON):

```
{ "slug": "my-article", "id": "42" }
```

`menu()` helper
---------------

[](#menu-helper)

Returns a cached nested tree for a given menu position code:

```
$items = menu('main');
// [
//   ['id' => 1, 'name' => 'Home', 'url' => '/', 'image' => null, 'target' => null, 'code' => 'main', 'children' => []],
//   ...
// ]
```

The tree is cached forever. It is automatically invalidated when a `Menu` model is saved or deleted. If you mutate menu data outside of Eloquent events (bulk updates, raw SQL) call `MenuRepository::forget($code)` manually.

Localization
------------

[](#localization)

UI strings are loaded from the `moonshine-pages` translation namespace:

- `lang/en/moonshine-pages.php`
- `lang/ru/moonshine-pages.php`

Publish to override:

```
php artisan vendor:publish --tag=moonshine-pages-lang
```

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance96

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Total

3

Last Release

34d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/75324054?v=4)[Maxim Bezvodinskikh](/maintainers/Dictator90)[@Dictator90](https://github.com/Dictator90)

---

Top Contributors

[![Dictator90](https://avatars.githubusercontent.com/u/75324054?v=4)](https://github.com/Dictator90 "Dictator90 (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mb4it-moonshine-pages/health.svg)

```
[![Health](https://phpackages.com/badges/mb4it-moonshine-pages/health.svg)](https://phpackages.com/packages/mb4it-moonshine-pages)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.6k](/packages/larastan-larastan)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M162](/packages/laravel-ai)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
