Registries Reference
Registries are Laravix's extension points — static classes in Laravix\Cms\Support where the core, your app and plugins register content types, fields, blocks, settings, routes and more. This is the complete reference with a minimal example for each.
ContentTypeRegistry
use Laravix\Cms\Support\{ContentTypeDefinition, ContentTypeRegistry};
ContentTypeRegistry::register(
ContentTypeDefinition::make('project')
->label('Project')->pluralLabel('Projects')
->linkableInNavigation() // offer in menu editor
->builder(false) // no visual builder tab
->routePrefix('projects') // public URLs /projects/{slug}
->taxonomyTypes(['category']), // allowed taxonomy types
);
Reading: all(), keys(), has($key), find($key), default() (the first registered type), options(), navigationLinkableKeys(). Details: Custom Content Types.
TaxonomyTypeRegistry
use Laravix\Cms\Support\TaxonomyTypeRegistry;
TaxonomyTypeRegistry::register('project-category', 'Project category');
The second argument is a label (plain string or translation key). Reading: options(), label($key).
FieldRegistry
use Laravix\Cms\Enums\FieldType;
use Laravix\Cms\Support\{FieldDefinition, FieldRegistry};
FieldRegistry::content([...]); // fields on every content type
FieldRegistry::contentType('project', [
FieldDefinition::make('year')
->type(FieldType::NUMBER)
->label('Year')
->group('Details')
->hint('Four digits.')
->config([]),
]);
Reading: forContentType($type, $siteId) merges code fields with admin-defined DB fields; grouped() groups them for form sections. Details: Custom Fields.
SettingRegistry
Adds fields to the Settings screen; values are stored per site and exposed to themes via $settings:
use Laravix\Cms\Enums\FieldType;
use Laravix\Cms\Support\{SettingDefinition, SettingRegistry};
SettingRegistry::register([
SettingDefinition::make('analytics_id')
->label('Analytics ID')
->group('laravix::settings.tabs.general') // pick a tab
->hint('Measurement ID, e.g. G-XXXX.')
->required()
->default(null)
->config([]),
]);
Types follow FieldType (text, textarea, image, url, boolean…). The tab shown in the admin is derived from the group translation key — reuse the core groups (laravix::settings.tabs.general, .seo, .social) or register your own group key.
BlockRegistry
use Laravix\Cms\Support\{BlockDefinition, BlockRegistry};
BlockRegistry::register(MyBlock::definition());
Definitions with canvasHtml appear in the visual builder; definitions with schema are editable as structured data. Details: Custom Blocks.
NavigationRegistry
The core registers header and footer. Register another to give sites an extra managed menu (it appears as a repeater on the Navigation screen and in the site's navigations JSON):
use Laravix\Cms\Support\{NavigationDefinition, NavigationRegistry};
NavigationRegistry::register(
NavigationDefinition::make('sidebar')->label('Sidebar Navigation'),
);
RouteRegistry
Queues route registration closures; Laravix runs them inside the web middleware group after the app boots, before the CMS catch-all route:
use Illuminate\Support\Facades\Route;
use Laravix\Cms\Support\RouteRegistry;
RouteRegistry::register(function () {
Route::get('/projects', ProjectIndexController::class)->name('projects.index');
Route::get('/projects/{slug}', ProjectShowController::class)->name('projects.show');
});
HydratorRegistry
Hydrators post-process the visual builder's HTML on every render — the changelog plugin uses one to inject release data into a placeholder block. Implement the BlockHydrator interface:
use Laravix\Cms\Models\{Content, Site};
use Laravix\Cms\Support\{BlockHydrator, HydratorRegistry};
class ProjectsHydrator implements BlockHydrator
{
public function hydrate(string $html, Site $site, Content $content): string
{
return str_replace('<!--projects-->', view('my-plugin::list')->render(), $html);
}
}
HydratorRegistry::register(ProjectsHydrator::class);
Hydrators are resolved from the container, so constructor injection works.
FilamentPluginRegistry
Hands full Filament plugins to the admin panel — resources, pages, widgets, render hooks. Must be called in a provider's register():
use Laravix\Cms\Support\FilamentPluginRegistry;
FilamentPluginRegistry::register(MyFilamentPlugin::make());
MyFilamentPlugin is a standard Filament\Contracts\Plugin implementation — see the changelog plugin's ChangelogPlugin class for a worked example.