RelationManagerExtension and register it with the LunarPanel facade.
Example
The following example extends theCustomerGroupPricingRelationManager to add a custom column to the form and table:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
How to extend Filament relation managers in the Lunar admin panel.
RelationManagerExtension and register it with the LunarPanel facade.
CustomerGroupPricingRelationManager to add a custom column to the form and table:
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Lunar\Admin\Support\Extending\RelationManagerExtension;
class MyCustomerGroupPricingExtension extends RelationManagerExtension
{
public function extendForm(Form $form): Form
{
return $form->schema([
...$form->getComponents(withHidden: true),
TextInput::make('custom_column'),
]);
}
public function extendTable(Table $table): Table
{
return $table->columns([
...$table->getColumns(),
TextColumn::make('product_code'),
]);
}
}
// Typically placed in a service provider...
LunarPanel::extensions([
\Lunar\Admin\Filament\Resources\ProductResource\RelationManagers\CustomerGroupPricingRelationManager::class => MyCustomerGroupPricingExtension::class,
]);
| Method | Description |
|---|---|
extendForm(Form $form) | Modify the relation manager’s form schema. |
extendTable(Table $table) | Modify the relation manager’s table columns and configuration. |
headerActions(array $actions) | Add or modify header actions. |