FilamentPHP Glow Filament Glow
beta
  • All Tricks
  • About
login
logo dark logo light

Use translatable for relations in select components

Image Description
By: Lara Zeus
  • Published: 25 Mar 2024 Updated: 04 May 2024
Forms Panels

get translatable attribute in a relationships

Use translatable for relations in select components

when using a relations in a select menu or a filter, and that model is translatable, this is how to get the translatable attribute:

1->getOptionLabelFromRecordUsing(fn (Model $record) => $record->title)

Back to Tricks
logo dark logo light

Related Tricks:

Filament form with factory data

Sometimes, when we need to test our application locally, we always have to fill forms manually. Let's take the Filament approach and achieve this with more accurate data.

Bypass required when save as draft

Unrequire fields recursively when saving as draft

Select All Items in a Dropdown Select

Let Users to Select All Options with a Simple Hint Action

Trigger hint action on hover

toggle the visibility of an action when hover the component

Make components globally translatable

Translating components can often be a repetitive task, Fortunately, there's a neat trick to automate this process, making your components instantly translatable.

Tweet
X GitHub RSS Feed
built with ❤️ using
filamentPHP
© 2026 Lara Zeus. All rights reserved.
Terms and Conditions Contact Us

Syntax highlighting by Torchlight .

FilamentPHP Glow Filament Glow
beta
    • All Tricks
    • About

Media Picker

  • No Files in the library or nothing found for your search.

Add Files

File