FilamentF
Filament2y ago
Marc

Unable to find component for relationship manager

I'm creating a relationship manager in a child panel, but when registering it I get this error Unable to find component: [app.filament.futbol.resources.club-resource.relation-managers.teams-relation-manager]

What do I have to do to solve it?

public static function getRelations(): array
{
    return [
        TeamsRelationManager::class
    ];
}

namespace App\Filament\Futbol\Resources\ClubResource\RelationManagers;
class TeamsRelationManager extends RelationManager
{
    protected static string $relationship = 'teams';

    public function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\TextInput::make('name')
                    ->required()
                    ->maxLength(255),
            ]);
    }

    public function table(Table $table): Table
    {
        return $table
            ->recordTitleAttribute('name')
            ->columns([
                Tables\Columns\TextColumn::make('name'),
            ])
            ->filters([
                //
            ])
            ->headerActions([
                Tables\Actions\CreateAction::make(),
            ])
            ->actions([
                Tables\Actions\EditAction::make(),
                Tables\Actions\DeleteAction::make(),
            ])
            ->bulkActions([
                Tables\Actions\BulkActionGroup::make([
                    Tables\Actions\DeleteBulkAction::make(),
                ]),
            ]);
    }
}
Was this page helpful?