GuavaCZ / filament-nested-resources

MIT License
107 stars 17 forks source link

[Bug]: CreateRelatedRecord and Translatable #26

Closed vblinden closed 7 months ago

vblinden commented 7 months ago

What happened?

Hi, I have a CreateRelatedRecord which uses the official Spatie Translatable plugin (https://filamentphp.com/plugins/filament-spatie-translatable).

How can I implement this for the CreateRelatedRecord? I can't add the LocaleSwitcher to the CreateRelatedRecord class, because the ParentResource doesn't have any translations.

How to reproduce the bug

Have a nested resource where the nested resource has translatable properties.

ParentResource -> NestedResource (use Translatable)

Package Version

1.0.0-beta.3

PHP Version

8.3.3

Laravel Version

10.10

Which operating systems does with happen with?

macOS

Notes

No response

lukas-frey commented 7 months ago

Hi @vblinden, thanks for the bug report! I've added a new Guava\FilamentNestedResources\Concerns\CreateRelatedRecord\Translatable class for the CreateRelatedRecord page, please use this one and it'll use the correct resource. It's included in 1.0.0-beta.4