Skip to main content
Lunar provides extension classes for each type of Filament page. These allow customizing headings, actions, widgets, form behavior, and lifecycle hooks. Place extension classes in the application, for example at App\Lunar\Extensions\MyCreateExtension. Once created, register the extension in a service provider.

CreatePageExtension

Extends create pages with custom headings, actions, widgets, and lifecycle hooks.

EditPageExtension

Extends edit pages with custom headings, actions, widgets, and lifecycle hooks.

ListPageExtension

Extends list pages with custom headings, actions, widgets, and tabs.

ViewPageExtension

Extends view pages with custom headings and actions.

RelationPageExtension

Extends relation pages with custom headings, actions, and table customization. Relation-style pages (those built on Lunar\Admin\Support\Pages\BaseManageRelatedRecords) include:
  • ManageBrandCollections, ManageBrandProducts
  • ManageCollectionChildren, ManageCollectionProducts
  • ManageProductAssociations, ManageProductCollections, ManageProductVariants
  • ManageVariantMedia
  • ManageUrlsRelatedRecords

Extending the table Added in 1.5

extendTable receives the page’s default table and returns the modified instance. It is the same seam used by resource and relation-manager extensions, so columns, actions, filters, and query modifiers can all be applied without replacing the page class. When no extension is registered, the default table behavior is unchanged.

Extending Pages in Addons

When building an addon for Lunar, a defensive approach is needed when modifying forms since the contents may have been altered by other extensions. Use getComponents() to retrieve the currently registered components before appending new ones: