Introduction

Overview

How Tagixo integrates with Filament v5 and what the SDK provides out of the box.

Filament SDK — Overview

The ccast/tagixo-filament package is the Filament adapter for the Tagixo visual builder. Its single responsibility is to wire the builder's core capabilities into a Filament v5 admin panel: registering the plugin, mounting builder pages as Filament pages or resource pages, delivering assets through Filament's asset pipeline, and exposing a thin set of Filament-specific helpers (form columns, filters, reactivity facade). Builder logic stays in Tagixo; panel wiring is the SDK's job.


What the Core Provides

The following concerns belong to ccast/tagixo and must never be duplicated in the adapter layer:

Concern Owner
Page, Layout, Menu, GlobalVariable models ccast/tagixo
Builder payload serialisation / deserialisation ccast/tagixo
Module registry and catalogue ccast/tagixo
PropType system and CSS generation ccast/tagixo
Public page rendering (PageRenderer) ccast/tagixo
Form schema definitions and submission pipeline ccast/tagixo
Asset compilation (JS / CSS bundles) ccast/tagixo
Migration files for all tgx_* tables consumer app (checked-in here)

Architecture

Plugin Registration

Register the SDK inside a Filament PanelProvider (or equivalent):

use Ccast\TagixoFilament\TagixoFilamentPlugin;

$panel->plugins([
    TagixoFilamentPlugin::make(),
]);

TagixoFilamentPlugin::make() performs three tasks at boot: it loads the SDK's service provider into the panel's IoC scope, registers all builder assets with Filament's FilamentAsset pipeline, and auto-discovers any BuilderPage subclasses in the paths configured via TagixoFilamentPlugin::discoverIn().

Reactivity Layer: Livewire

Unlike LiVue (which manages reactivity through its own Vue-based diffing) and Primix (which routes reactivity through its own form abstraction), the Filament SDK delegates to Livewire for all component re-renders. Builder state mutations dispatch Livewire events that Filament's standard wire:model and $dispatch infrastructure handles. This means:

  • You can use Filament's $this->js(), $this->dispatch(), and $refresh inside BuilderPage subclasses without any SDK-specific overrides.
  • Custom reactivity logic that would belong in a Primix PrimixFormField belongs instead in a Livewire component or a Filament Action.
  • Server-sent events are not supported; use polling or standard Livewire push patterns.

BuilderPage Base Class

All builder pages in a Filament panel must extend Ccast\TagixoFilament\Pages\BuilderPage. The base class enforces a three-method contract:

abstract protected function resolveRecord(): \Ccast\Tagixo\Models\Page;
abstract protected function getBuilderConfig(): array;
abstract protected function afterSave(array $payload): void;
Method Responsibility
resolveRecord() Load the Page (or Layout, etc.) this page edits.
getBuilderConfig() Return the array of builder options forwarded to the JS bootstrap.
afterSave(array $payload) React to a save event — e.g., clear caches, dispatch jobs.

Scaffold a new builder page with:

php artisan tagixo:filament-page {name}

What the SDK Provides Out of the Box

Builder Pages

The SDK ships two concrete page types:

  • StandaloneBuilderPage — edits a Page record identified by slug or ID, not tied to any Filament resource. Mount at any panel path.
  • ResourceBuilderPage — extends Filament's EditRecord lifecycle, making a builder the edit view of any resource that stores a Tagixo payload column.

Both types integrate with Filament's breadcrumb, navigation, and authorization APIs.

Asset Delivery

The SDK registers builder JS and CSS bundles through FilamentAsset::register(). Assets are served from public/vendor/tagixo/ (the directory committed in this repo). After updating ccast/tagixo, re-publish with:

php artisan vendor:publish --tag=tagixo-assets --force

Never symlink or load assets directly from vendor/; the production Docker image runs --no-scripts and the public/vendor/tagixo/ snapshot must be committed.

Form-Table Helpers

FilamentFormColumns, FilamentFilters, and FilamentFormStyles mirror the PropType system into Filament table columns and form components. They read the same 32-prop schema as the Primix equivalents so that field definitions stay in one place and both panel adapters render them consistently.

Form Field Reactivity (Level 3)

The TagixoReactivity facade provides Level-3 field reactivity — conditional visibility, cascading selects, and live preview — without writing custom Livewire event listeners. Use it inside any Filament form schema:

use Ccast\TagixoFilament\Facades\TagixoReactivity;

TagixoReactivity::bindTo($form)->withCascade('type', 'subtype');

Media Gallery Integration

The SDK registers a MediaGalleryAction compatible with Filament's action bus. Drop it into any form component to open the Tagixo media picker as a modal without leaving the panel page.

Notifications and Actions

Standard Filament Notification::make() and Action::make() patterns work without any wrapping. The SDK does not introduce its own notification bus — use Filament's.


Version Compatibility

Requirement Minimum Tested maximum
PHP 8.2 8.3
Laravel 11.x 13.x
Filament 3.2 3.x latest
ccast/tagixo (core) 1.0.50
Livewire 3.4 3.x latest

Filament v4 and below are not supported. The SDK requires Filament 5.x (^5.0).


SDK vs. Standalone vs. Primix

Dimension Filament SDK Standalone integration Primix
Admin framework Filament v5 None (plain Laravel) Primix
Reactivity layer Livewire 3 Vue 3 + Pinia LiVue / Primix forms
Builder base class BuilderPage StandaloneBuilderController BuildPage action
Form/table helpers FilamentFormColumns / FilamentFilters Not applicable PrimixFormField
Stored payload JSON tgx_pages.content (shared) tgx_pages.content (shared) tgx_pages.content (shared)
Public render pipeline PageRenderer (shared) PageRenderer (shared) PageRenderer (shared)

The three integrations share the same database tables and payload format. They can coexist in the same Laravel app — for example, using Primix for the main admin panel while exposing a Filament-based builder for a specific resource. The public render pipeline is always identical regardless of which admin adapter authored the page.


Quick-Start Summary

# 1. Require the package (needs GitHub PAT for ccast/tagixo)
composer require ccast/tagixo-filament

# 2. Publish assets
php artisan vendor:publish --tag=tagixo-assets --force

# 3. Run any new migrations
php artisan migrate

# 4. Register the plugin in your PanelProvider
#    $panel->plugins([TagixoFilamentPlugin::make()])

# 5. Scaffold your first builder page
php artisan tagixo:filament-page PageBuilder

Recommended Implementation Rules

  1. Persistence location — store all builder payload in tgx_pages.content via the models provided by ccast/tagixo. Do not add a parallel content column in app migrations.
  2. No render forks — the public PageRenderer is the single render path. Do not add Filament-specific Blade partials that replicate renderer logic.
  3. Bootstrap as source of truth — pass builder configuration exclusively through getBuilderConfig(). Do not inject JS globals from a separate view composer.
  4. Auth at resource layer — enforce page-edit authorization in Filament's authorize() or canAccess() hooks, not inside resolveRecord().
  5. Preview routing — use the plugin's built-in preview route (/tagixo/preview/{token}) for live-preview links. Do not expose unauthenticated access to unpublished pages through the public /{slug} route.
  6. Asset re-publish discipline — after every composer update ccast/tagixo, re-run vendor:publish --tag=tagixo-assets --force and commit the updated public/vendor/tagixo/ directory before pushing.

See Also