Skip to content

Filament ​

Introduction ​

Filament is kitloom's primary admin panel. Every module has a -filament package, and the admin is laid out like wp-admin: Posts, Media, Pages, Comments, Contact, Appearance, Users, Tools, Settings — with module sections slotted in where WordPress plugins would put them.

Requirements: Filament 5, Livewire 4, Laravel 11 or 12.

Setting up the panel ​

kitloom works with the panel your application already has. A minimal AdminPanelProvider, as in the Filament skeleton:

php
use Kitloom\WpSchema\Filament\Auth\Login;
use Kitloom\WpSchema\Filament\Auth\Register;
use Kitloom\WpSchema\Filament\Users\Profile;

return $panel
    ->default()
    ->id('admin')
    ->path('admin')
    ->login(Login::class)
    // Sign-up exists only while Settings → General → Membership allows it.
    ->registration(Register::class)
    ->profile(Profile::class, isSimple: false)
    ->navigationItems([Profile::navigationItem()])
    ->discoverResources(in: app_path('Filament/Resources'), for: 'App\Filament\Resources')
    // ...

Login, Register and Profile from kitloom/wp-schema-filament are optional; they add WordPress behaviour — registration controlled by the Anyone can register option with its default role, and a profile page with WordPress user fields.

The User model implements Filament\Models\Contracts\FilamentUser; with the roles module, canAccessPanel() returns $this->can('read').

How modules attach ​

Each -filament package registers a Filament plugin from its service provider with Panel::configureUsing(). The callback runs for every panel as it is built, so sections appear without touching your panel provider:

php
Panel::configureUsing(function (Panel $panel): void {
    if (! (bool) config('redirects.filament.register', true)) {
        return;
    }

    $panel->plugin(RedirectsPlugin::make());
});

kitloom plugins are idempotent — adding the same plugin from your provider does not duplicate anything. To place a module's resources yourself, switch off its automatic registration (*.filament.register, see Configuration) and add the plugin or its resources where you want them.

Navigation groups follow WordPress order, held by Kitloom\WpSchema\Filament\MenuOrder. A module inserts its own group relative to an existing one:

php
use Kitloom\WpSchema\Filament\MenuOrder;

$this->app->afterResolving(MenuOrder::class, fn (MenuOrder $order) => $order->after('Custom Fields', 'Settings'));

Empty groups are not shown.

Letting administrators rearrange the menu ​

kitloom/filament-admin-menu adds Settings → Admin Menu: reorder groups and items, move items between groups, rename and hide them, and reset to the default. Changes are stored in the filament_menu_overrides table; a newly installed module's items go to the end until someone places them.

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

Form sections ​

Modules add blocks to other resources' forms — SEO fields on posts, Custom Fields on terms and users, Featured Image on posts — through Kitloom\WpSchema\Filament\Forms\FormSection implementations tagged with FormSections::TAG. kitloom's own resources show them automatically.

Your own resources can show them too — for example the site's UserResource:

php
use Kitloom\WpSchema\Filament\Forms\FormSections;

public static function form(Schema $schema): Schema
{
    return $schema->components([
        // your fields…
        ...app(FormSections::class)->sectionsFor(static::class),
    ]);
}

See Extension Points › Blocks on the post form.

Settings pages ​

kitloom/settings-filament provides SettingsPage: a Filament page whose field names are rows of the options table. A subclass only declares fields:

php
use Filament\Forms\Components\TextInput;
use Kitloom\Settings\Filament\SettingsPage;

class SocialSettings extends SettingsPage
{
    protected static ?string $navigationLabel = 'Social';

    protected function settingsFields(): array
    {
        return [
            TextInput::make('social_twitter')->url(),
            TextInput::make('social_github')->url(),
        ];
    }
}

Values are read back on the site with Kitloom\Settings\Settings — through the same cached store every module uses. The page asks the Gate about itself, so declare a permission for it.

Custom post types ​

Post types and taxonomies created on Custom Fields → Post Types / Taxonomies (kitloom/post-types-filament) get admin sections immediately — /admin/types/{type} and /admin/taxonomies/{taxonomy} — built with Filament resource configurations, without generating classes. A new type shows up on the next request (restart Octane or clear the route cache if you use them).

What's where ​

SectionPackage
Posts, Pages, Categories, Tags, Commentskitloom/wp-schema-filament
Settings → General, Writing, Permalinks, Widgetskitloom/wp-schema-filament
Media → Library, Featured Image blockkitloom/media-filament
Appearance → Menus, menu locationskitloom/navigation-filament
Appearance → Themeskitloom/themes-filament
Modules → Installed Moduleskitloom/modules-filament
Users → Roles, Role fieldkitloom/permissions-filament
Settings → Admin Menukitloom/filament-admin-menu
Module sectionssee the catalog