© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
10 replies
Algorithm

Change the language of Select Component

I have a form and that form has a Select component that has relationship with department table.

The problem that I faced is that when I change the language in create then select data stays in the same language and doesn't change.
I use Spatie/Translatable plugin.

The component with relationship is:
  Forms\Components\Select::make('department')
  ->relationship('department', 'name')
  ->preload()
  Forms\Components\Select::make('department')
  ->relationship('department', 'name')
  ->preload()


Department Model:
    use HasTranslations;

    public $translatable = [
        'name'
    ];

    protected $fillable = [
        'name'
    ];
    use HasTranslations;

    public $translatable = [
        'name'
    ];

    protected $fillable = [
        'name'
    ];


CreateJob.php
    use CreateRecord\Concerns\Translatable;

    protected static string $resource = JobResource::class;

    protected function getActions(): array
    {
        return [
            Actions\LocaleSwitcher::make(),
        ];
    }
    use CreateRecord\Concerns\Translatable;

    protected static string $resource = JobResource::class;

    protected function getActions(): array
    {
        return [
            Actions\LocaleSwitcher::make(),
        ];
    }


Thank you.
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

How to change the suffix value of a component after select component setted
FilamentFFilament / ❓┊help
3y ago
Select Component
FilamentFFilament / ❓┊help
3y ago
Can I change the language of a package without a language file?
FilamentFFilament / ❓┊help
17mo ago