Skip to content

Nova ​

Introduction ​

kitloom supports Laravel Nova 5 through -nova packages built on the same domain packages as the Filament ones. A Nova site and a Filament site share content, settings and modules; only the admin differs.

Requirements: Laravel Nova 5 (licensed), Laravel 11 or 12.

Inertia version

Recent Nova releases accept both inertiajs/inertia-laravel v2 and v3. Vue themes built on @inertiajs/vue3 v1 need v2 on the server — kitloom/portfolio-theme requires ^2.0, so Composer keeps it there.

Setting up Nova ​

Install Nova as usual and let in whoever may read — every role, like wp-admin:

php
// app/Providers/NovaServiceProvider.php
protected function gate(): void
{
    Gate::define('viewNova', fn (User $user): bool => $user->can('read'));
}

The Nova skeleton serves Nova at /nova.

How modules attach ​

A -nova package registers its resources and tools itself, inside Nova::serving(), and does nothing when Nova is not installed:

php
public function boot(): void
{
    if (! class_exists(Nova::class) || ! (bool) config('redirects.nova.register', true)) {
        return;
    }

    Nova::serving(function (): void {
        Nova::resources([RedirectionResource::class, NotFoundLogResource::class]);

        if ((bool) config('redirects.nova.menu', true)) {
            Nova::tools([new Redirects(/* ... */)]);
        }
    });
}

Many packages have two switches: *.nova.register removes the resources entirely, *.nova.menu removes only the sidebar section so the site can list the resources in its own menu. See Configuration.

Overriding a resource ​

To customise a kitloom resource, extend it and register your class in NovaServiceProvider. kitloom packages look for a subclass among the registered resources (ResourceOverride::find()) and use yours instead of their own — no duplicate URLs:

php
namespace App\Nova;

use Kitloom\Redirects\Nova\Resources\RedirectionResource as BaseResource;

class RedirectionResource extends BaseResource
{
    public static $perPageOptions = [50, 100];
}

The resource's model follows config('wp-schema.models'), so swapping the model does not require overriding the resource.

Form tabs ​

Modules add tabs to other resources' forms — SEO, Custom Fields, Featured Image — through Kitloom\WpSchema\Nova\Forms\FormSection implementations tagged with FormSections::TAG. Resources that use the HasFormSections trait show them; every kitloom content resource does. A Nova form section returns fields(), the metaKeys() it owns and can prepare and save each value (prepareMetaValue(), saveMetaValue()).

Settings pages ​

kitloom/settings-nova provides SettingsTool: a Nova tool with settings pages whose values are rows of the options table. Extend it to declare your pages; values are read on the site through Kitloom\Settings\Settings.

The sidebar ​

kitloom/nova-admin-menu lets administrators reorder and nest sidebar entries by dragging, from the admin itself. The Nova skeleton uses it, with a migration that arranges the menu in WordPress order. The Modules and Themes screens are put into place the same way (Appearance → Themes, Modules between Appearance and Users).

bash
composer require kitloom/nova-admin-menu
php artisan migrate

What's where ​

SectionPackage
Posts, Pages, Categories, Tags, Comments, Settingskitloom/wp-schema-nova
Media library, Featured Image tabkitloom/media-nova
Menuskitloom/navigation-nova
Appearance → Themes (/nova/themes)kitloom/themes-nova
Modules → Installed Modules (/nova/modules)kitloom/modules-nova
Users → Roles, Role field and filterkitloom/permissions-nova
Module sectionssee the catalog

Differences from Filament ​

Filament is the primary direction; most new screens appear there first. At the time of writing every module listed in the catalog has both packages. Panel-specific helpers — the admin menu editors — exist for one panel only. Html content in Nova (post text, WYSIWYG custom fields) is edited in a code field by default; a visual editor such as TinyMCE plugs in by binding the HtmlEditor contract of kitloom/wp-schema-nova.