How to use AttachAction with Translatable resource?

Hey guys, I have resource Diagnosis that has SymptomsRelationManager. Symptoms are translatable via Spatie Translatable. I have AttachAction, but it returs to me objects as records. How can I set it tu currently activeLocale?
class SymptomsRelationManager extends RelationManager
{
use Translatable;

#[Reactive]
public ?string $activeLocale = null;

public function table(Table $table): Table
{
return $table
->headerActions([
Tables\Actions\AttachAction::make()
->preloadRecordSelect(),
...
]);
}
class SymptomsRelationManager extends RelationManager
{
use Translatable;

#[Reactive]
public ?string $activeLocale = null;

public function table(Table $table): Table
{
return $table
->headerActions([
Tables\Actions\AttachAction::make()
->preloadRecordSelect(),
...
]);
}
1 Reply
Trauma Zombie
Trauma ZombieOP17mo ago
I have one more problem: When I am on EditRecord, it works just fine, but when I switch to ViewRecord, it throws me exception: Cannot mutate reactive prop [activeLocale] in component: [app.filament.resources.diagnosis-resource.relation-managers.symptoms-relation-manager] I am not sure why. I have Translatable concern on View set.
Want results from more Discord servers?
Add your server