© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
Quin.

Column relationship

hello i wanted to show the domainextension price! but i think i got something wrong 😦

    public static function table(Table $table): Table
    {
        return $table
            ->columns([
                Tables\Columns\TextColumn::make('domain')->searchable(),
                Tables\Columns\BadgeColumn::make('domain_status')
                    ->colors([
                        'success' => static fn ($status): bool => strpos(strtolower($status), 'vrij') !== false,
                        'danger' => static fn ($status): bool => strpos(strtolower($status), 'bezet') !== false,
                    ]),
                Tables\Columns\TextColumn::make('domainextension.price'),
            ])
    public static function table(Table $table): Table
    {
        return $table
            ->columns([
                Tables\Columns\TextColumn::make('domain')->searchable(),
                Tables\Columns\BadgeColumn::make('domain_status')
                    ->colors([
                        'success' => static fn ($status): bool => strpos(strtolower($status), 'vrij') !== false,
                        'danger' => static fn ($status): bool => strpos(strtolower($status), 'bezet') !== false,
                    ]),
                Tables\Columns\TextColumn::make('domainextension.price'),
            ])


domainExtension Model:
public function domaincheckrecord()
    {
        return $this->hasMany(DomainCheckRecord::class);
    }
public function domaincheckrecord()
    {
        return $this->hasMany(DomainCheckRecord::class);
    }

DomainCheckRecord model:
    public function domainextension():belongsTo
    {
        return $this->belongsTo(DomainExtension::class);
    }
    public function domainextension():belongsTo
    {
        return $this->belongsTo(DomainExtension::class);
    }
Solution
Fixed it! just needed to add the foreignkey in the domainextension():belongsTo
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Relationship Column
FilamentFFilament / ❓┊help
3y ago
Summarize Relationship Column
FilamentFFilament / ❓┊help
3y ago
Avg() column from Relationship
FilamentFFilament / ❓┊help
2y ago
Checkboxlist relationship with additional column
FilamentFFilament / ❓┊help
13mo ago