© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
6 replies
nowak

TextColumn get relationship record

Is it possible to get the $record of the relationship of a resource when creating a TextColumn like this:
Tables\Columns\TextColumn::make('skus.price')
  ->label('Price')
  ->listWithLineBreaks()
  ->formatStateUsing(function ($state, $record) {
      \Log::info('Current record:', [$record]);
      return $state;
  }),
Tables\Columns\TextColumn::make('skus.price')
  ->label('Price')
  ->listWithLineBreaks()
  ->formatStateUsing(function ($state, $record) {
      \Log::info('Current record:', [$record]);
      return $state;
  }),

This was added to my ProductResource, where the above log output gives the product record. Is it somehow possible to get the sku record that the price belongs to instead?
Solution
no, there is not currently a way to do that, but you could guess which sku it is based on the price
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

TextColumn relationship unique values
FilamentFFilament / ❓┊help
3y ago
Get relationship Select record data from $get
FilamentFFilament / ❓┊help
3y ago
Get parent record in Relationship Manager
FilamentFFilament / ❓┊help
3y ago
$recordTitleAttribute relationship
FilamentFFilament / ❓┊help
3y ago