© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
10 replies
frame

V4 Custom data in a RelationManager

I want one of the tabs of my User's relation tables to use custom data. I assume I need to use a relation manager for that, but how do I use custom data in a relation manager?
I tried
class ResultsRelationManager extends RelationManager
{
    protected static string $relationship = 'results';

    public function table(Table $table): Table
    {
        return $table
            ->records(fn (): array => [
                ['name' => 'Test result']
            ])
            ->columns([
                TextColumn::make('name'),
            ]);
    }
}
class ResultsRelationManager extends RelationManager
{
    protected static string $relationship = 'results';

    public function table(Table $table): Table
    {
        return $table
            ->records(fn (): array => [
                ['name' => 'Test result']
            ])
            ->columns([
                TextColumn::make('name'),
            ]);
    }
}

but I'm getting error
Filament\Resources\RelationManagers\RelationManager::{closure:Filament\Resources\Concerns\InteractsWithRelationshipTable::makeTable():106}(): Argument #1 ($record) must be of type Illuminate\Database\Eloquent\Model, array given, called in vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 36
Filament\Resources\RelationManagers\RelationManager::{closure:Filament\Resources\Concerns\InteractsWithRelationshipTable::makeTable():106}(): Argument #1 ($record) must be of type Illuminate\Database\Eloquent\Model, array given, called in vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 36
Solution
There's not much difference.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

V4 Custom Page with Custom Data Table
FilamentFFilament / ❓┊help
8mo ago
Custom Table Name in RelationManager ?
FilamentFFilament / ❓┊help
16mo ago
custom action in v4 changes?
FilamentFFilament / ❓┊help
6mo ago
Custom attribute name in RelationManager $recordTitleAttribute
FilamentFFilament / ❓┊help
3y ago