F
Filament7mo 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
];
}
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(),
]),
]);
}
}
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(),
]),
]);
}
}
3 Replies
Marc
MarcOP7mo ago
class FutbolbasePanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('futbol')
->path('futbol')
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Futbol/Resources'), for: 'App\\Filament\\Futbol\\Resources')
->discoverPages(in: app_path('Filament/Futbol/Pages'), for: 'App\\Filament\\Futbol\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Futbol/Widgets'), for: 'App\\Filament\\Futbol\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}
class FutbolbasePanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('futbol')
->path('futbol')
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Futbol/Resources'), for: 'App\\Filament\\Futbol\\Resources')
->discoverPages(in: app_path('Filament/Futbol/Pages'), for: 'App\\Filament\\Futbol\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Futbol/Widgets'), for: 'App\\Filament\\Futbol\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}
Toni
Toni6mo ago
Did you solve this? I got the same error php artisan filament:clear-cached-components solved it
pythonista
pythonista5mo ago
Thank you. This solved the issue
Want results from more Discord servers?
Add your server