PHPackages                             optimistdigital/nova-page-manager - 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. optimistdigital/nova-page-manager

ActiveLibrary[Admin Panels](/categories/admin)

optimistdigital/nova-page-manager
=================================

Page(s) and region(s) manager for Laravel Nova.

6.0.0(8mo ago)17988.5k↓42.9%41[5 issues](https://github.com/outl1ne/nova-page-manager/issues)[2 PRs](https://github.com/outl1ne/nova-page-manager/pulls)MITPHPPHP &gt;=8.0CI passing

Since Mar 27Pushed 8mo ago5 watchersCompare

[ Source](https://github.com/outl1ne/nova-page-manager)[ Packagist](https://packagist.org/packages/optimistdigital/nova-page-manager)[ GitHub Sponsors](https://github.com/outl1ne)[ RSS](/packages/optimistdigital-nova-page-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (140)Used By (0)

Nova Page Manager
=================

[](#nova-page-manager)

[![Latest Version on Packagist](https://camo.githubusercontent.com/99e92ceb94c87f3fce693397f70409e84cc5e7b8b23a716d77195f63641a0c7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f75746c316e652f6e6f76612d706167652d6d616e616765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/outl1ne/nova-page-manager)[![Total Downloads](https://camo.githubusercontent.com/ed83b25c9c05a89d2db9735026cd44e00473eeaad52c1b9e2f18e2a75cea6deb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f75746c316e652f6e6f76612d706167652d6d616e616765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/outl1ne/nova-page-manager)

This [Laravel Nova](https://nova.laravel.com) package allows you to create and manage pages and regions for your frontend application.

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

[](#requirements)

```
- PHP >=8.0
- laravel/nova ^4.13

```

Features
--------

[](#features)

- Page and region management w/ custom fields
- Multiple locale support

Screenshots
-----------

[](#screenshots)

[![Form (dark)](docs/screenshots/form-dark.jpeg)](docs/screenshots/form-dark.jpeg)

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

[](#installation)

Install the package in a Laravel Nova project via Composer and run migrations:

```
# Install package
composer require outl1ne/nova-page-manager

# Run automatically loaded migrations
php artisan migrate
```

Publish the `nova-page-manager` configuration file and edit it to your preference:

```
php artisan vendor:publish --provider="Outl1ne\PageManager\NPMServiceProvider" --tag="config"
```

Register the tool with Nova in the `tools()` method of the `NovaServiceProvider`:

```
// in app/Providers/NovaServiceProvider.php

public function tools()
{
    return [
        // ...
        new \Outl1ne\PageManager\PageManager()
          ->withSeoFields(fn () => []), // Optional
    ];
}
```

Usage
-----

[](#usage)

### Creating templates

[](#creating-templates)

Templates can be created using the following Artisan command:

```
php artisan npm:template {className}
```

This will ask you a few additional details and will create a base template in `App\Nova\Templates`.

The base template exposes a few overrideable functions:

```
// Name displayed in CMS
public function name(Request $request)
{
    return parent::name($request);
}

// Fields displayed in CMS
public function fields(Request $request): array
{
    return [];
}

// Resolve data for serialization
public function resolve($page): array
{
    // Modify data as you please (ie turn ID-s into models)
    return $page->data;
}

// Page only
// Optional suffix to the route (ie {blogPostName})
public function pathSuffix() {
    return null;
}
```

### Registering templates

[](#registering-templates)

All your templates have to be registered in the `config/nova-page-manager.php` file.

```
// in /config/nova-page-manager.php

// ...
'templates' => [
    'pages' => [
        'home-page' => [
            'class' => '\App\Nova\Templates\HomePageTemplate',
            'unique' => true, // Whether more than one page can be created with this template
        ],
    ],
    'regions' => [
        'header' => [
            'class' => '\App\Nova\Templates\HeaderRegionTemplate',
            'unique' => true,
        ],
    ],
],
// ...
```

### Defining locales

[](#defining-locales)

The locales are defined in the config file.

```
// in /config/nova-page-manager.php

// ...
'locales' => [
  'en' => 'English',
  'et' => 'Estonian',
],

// OR

'locales' => function () {
  return Locale::all()->pluck('name', 'key');
},

// or if you wish to cache the configuration, pass a function name instead:

'locales' => NPMConfiguration::class . '::locales',
// ...
```

### Add links to front-end pages

[](#add-links-to-front-end-pages)

To display a link to the actual page next to the slug, add or overwrite the value in `config/nova-page-manager.php` for the key `base_url`.

```
// in /config/nova-page-manager.php

'base_url' => 'https://webshop.com', // Will add slugs to the end to make the URLs
```

### Overwriting models and resources

[](#overwriting-models-and-resources)

You can overwrite the page/region models or resources, just set the new classes in the config file.

### Custom locale display

[](#custom-locale-display)

To customize the locale display you can use `Nova::provideToScript` to pass `customLocaleDisplay` as in the example below.

```
// in app/Providers/NovaServiceProvider.php

public function boot()
{
    Nova::serving(function () {
        Nova::provideToScript([
            // ...
            'customLocaleDisplay' => [
                'en' => ,
                'et' => ,
            ]
        ]);
    });
}
```

Advanced usage
--------------

[](#advanced-usage)

### Non-translatable panels

[](#non-translatable-panels)

There's some cases where it's more sensible to translate sub-fields of a panel instead of the whole panel. This is possible, but is considered an "advanced usecase" as the feature is really new and experimental, also the developer experience of it is questionable.

You can create a non-translatable panel like so:

```
// In your PageTemplate class

public function fields() {
  return [
    Panel::make('Some panel', [
      Text::make('Somethingsomething'),
      Text::make('Sub-translatable', 'subtranslatable')
        ->translatable(),
    ])
    ->translatable(false),
  ];
}
```

This will create a key with `__` in the page data object. This means that the page data will end up looking something like this:

```
[
  '__' => [
    'somethingsomething' => 'your value',
    'subtranslatable' => [
      'en' => 'eng value',
      'et' => 'et value'
    ]
  ],
  'en' => [],
  'et' => [],
]
```

Helper functions
----------------

[](#helper-functions)

Helper functions can be found in the `Outl1ne\PageManager\Helpers\NPMHelpers` class.

### NPMHelpers::getPagesStructure()

[](#npmhelpersgetpagesstructure)

Calls `resolve()` on their template class and returns all pages as a tree where child pages are nested inside the `children` array key recursively.

### NPMHelpers::getPages()

[](#npmhelpersgetpages)

Calls `resolve()` on their template class and returns all pages. Returns an array of arrays.

### NPMHelpers::getRegions()

[](#npmhelpersgetregions)

Calls `resolve()` on their template class and returns all regions. Returns an array of arrays.

### NPMHelpers::getPageByTemplate($templateSlug)

[](#npmhelpersgetpagebytemplatetemplateslug)

Finds a single page by its template slug (from the config file), calls `resolve()` on its template class and returns it.

### NPMHelpers::getPagesByTemplate($templateSlug)

[](#npmhelpersgetpagesbytemplatetemplateslug)

Same as `getPageByTemplate`, but returns an array of pages.

### NPMHelpers::formatPage($page)

[](#npmhelpersformatpagepage)

Calls `resolve()` on the page's template class and returns the page as an array.

### NPMHelpers::formatRegion($region)

[](#npmhelpersformatregionregion)

Calls `resolve()` on the region's template class and returns the region as an array.

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

[](#localization)

The translation file(s) can be published by using the following command:

```
php artisan vendor:publish --provider="Outl1ne\PageManager\ToolServiceProvider" --tag="translations"
```

You can add your translations to `resources/lang/vendor/nova-page-manager/` by creating a new translations file with the locale name (ie `et.json`) and copying the JSON from the existing `en.json`.

Example of route and controller to serve pages
----------------------------------------------

[](#example-of-route-and-controller-to-serve-pages)

In routes/web.php

```
Route::get('/page/{path?}', [PageController::class, 'show'])
    ->where('path', '[\w-]+');
```

In the controller

```
public function show(Request $request, $path = '/')
    {

        // Get the current locale
        $locale = App::getLocale();
        $locales = NPM::getLocales();

        // Force a valid locale
        if (!isset($locales[$locale])) {
            $locale = array_key_first($locales);
        }

        // get page model class
        $pageModel = NPM::getPageModel();

        // get the model istance
        $page = $pageModel::where('active', true)
        ->where(function($query) use ($locales, $path) {
            foreach($locales as $locale => $name){
                $query->orWhere('slug->' . $locale, $path);
            }
        })
        ->first();

        // return 404 if page not found
        if (!$page) {
            abort(404);
        }

        // Get the page template
        $templateSlug = $page->template;

        // Prepare page data
        // maybe here you should filter the data by the locale
        $pageData = $page->toArray();

        // Render the dynamic page component
        return Inertia::render('DynamicPage', [
            'page' => $pageData,
            'template' => $templateSlug,
            //maybe here you're interested also in regions
            //'regions' => NPM::getRegions(),
        ]);

        //OR

        //  return view('page', [
        //     'page' => $pageData,
        //     'template' => $templateSlug,
        // ]);

        //OR

        //  return view('page.' . $templateSlug, [
        //     'page' => $pageData,
        // ]);

        // ...
    }
```

Credits
-------

[](#credits)

- [Tarvo Reinpalu](https://github.com/Tarpsvo)
- [Kaspar Rosin](https://github.com/KasparRosin)

License
-------

[](#license)

Nova page manager is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance59

Moderate activity, may be stable

Popularity48

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 78.5% 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 ~17 days

Recently: every ~199 days

Total

135

Last Release

253d ago

Major Versions

2.3.2 → 3.0.02020-01-17

3.5.3 → 4.0.02021-06-18

4.0.5 → 5.0.02022-06-09

v4.x-dev → 5.8.42022-11-22

5.9.3 → 6.0.02025-09-08

PHP version history (2 changes)1.0.0PHP &gt;=7.1.0

5.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1c2970763f51ca6ffcc1f1b6971a472b6b36a74d5eeb5446fb9d1caab44d016?d=identicon)[Tarpsvo](/maintainers/Tarpsvo)

---

Top Contributors

[![Tarpsvo](https://avatars.githubusercontent.com/u/2018660?v=4)](https://github.com/Tarpsvo "Tarpsvo (490 commits)")[![KasparRosin](https://avatars.githubusercontent.com/u/33309407?v=4)](https://github.com/KasparRosin "KasparRosin (51 commits)")[![Mikkoun](https://avatars.githubusercontent.com/u/9199470?v=4)](https://github.com/Mikkoun "Mikkoun (18 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (15 commits)")[![marttinnotta](https://avatars.githubusercontent.com/u/7058209?v=4)](https://github.com/marttinnotta "marttinnotta (8 commits)")[![kaareloun](https://avatars.githubusercontent.com/u/19284921?v=4)](https://github.com/kaareloun "kaareloun (7 commits)")[![allantatter](https://avatars.githubusercontent.com/u/386999?v=4)](https://github.com/allantatter "allantatter (6 commits)")[![slovenianGooner](https://avatars.githubusercontent.com/u/1257629?v=4)](https://github.com/slovenianGooner "slovenianGooner (4 commits)")[![Gertiozuni](https://avatars.githubusercontent.com/u/26062255?v=4)](https://github.com/Gertiozuni "Gertiozuni (4 commits)")[![shahruslan](https://avatars.githubusercontent.com/u/45426321?v=4)](https://github.com/shahruslan "shahruslan (3 commits)")[![lvdhoorn](https://avatars.githubusercontent.com/u/22305189?v=4)](https://github.com/lvdhoorn "lvdhoorn (3 commits)")[![trippo](https://avatars.githubusercontent.com/u/497169?v=4)](https://github.com/trippo "trippo (2 commits)")[![matthewjumpsoffbuildings](https://avatars.githubusercontent.com/u/41524?v=4)](https://github.com/matthewjumpsoffbuildings "matthewjumpsoffbuildings (2 commits)")[![RibesAlexandre](https://avatars.githubusercontent.com/u/818564?v=4)](https://github.com/RibesAlexandre "RibesAlexandre (2 commits)")[![ferdiunal](https://avatars.githubusercontent.com/u/5059851?v=4)](https://github.com/ferdiunal "ferdiunal (1 commits)")[![kikoseijo](https://avatars.githubusercontent.com/u/1528668?v=4)](https://github.com/kikoseijo "kikoseijo (1 commits)")[![murad-optimist](https://avatars.githubusercontent.com/u/81748898?v=4)](https://github.com/murad-optimist "murad-optimist (1 commits)")[![akiyamaSM](https://avatars.githubusercontent.com/u/12276076?v=4)](https://github.com/akiyamaSM "akiyamaSM (1 commits)")[![kakajansh](https://avatars.githubusercontent.com/u/7093483?v=4)](https://github.com/kakajansh "kakajansh (1 commits)")[![jgile](https://avatars.githubusercontent.com/u/3780633?v=4)](https://github.com/jgile "jgile (1 commits)")

---

Tags

laravel-novalaravelpagemanagernova

### Embed Badge

![Health badge](/badges/optimistdigital-nova-page-manager/health.svg)

```
[![Health](https://phpackages.com/badges/optimistdigital-nova-page-manager/health.svg)](https://phpackages.com/packages/optimistdigital-nova-page-manager)
```

###  Alternatives

[outl1ne/nova-page-manager

Page(s) and region(s) manager for Laravel Nova.

17945.1k](/packages/outl1ne-nova-page-manager)[optimistdigital/nova-settings

A Laravel Nova tool for editing custom settings using native Nova fields.

297874.5k3](/packages/optimistdigital-nova-settings)[whitecube/nova-page

Static pages content management for Laravel Nova

23995.2k1](/packages/whitecube-nova-page)[khalin/nova-link-field

A Laravel Nova Link field.

31562.2k2](/packages/khalin-nova-link-field)[digital-creative/nova-dashboard

The missing dashboard for nova.

7169.3k1](/packages/digital-creative-nova-dashboard)

PHPackages © 2026

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