tuseto
Filament repeater translations messed up structure on save
When create repeater first row for the model on
bg
language the result in the db is:
{"bg":[{"name":"first","slug":"first"}],"de":""}
Adding second row for same language is okay and the result is:
{"bg":[{"name":"first","slug":"first"},{"name":"second","slug":"second"}],"de":""}
Then when change the language to en
and add the first row in the repeater everything breaks:
{"bg":{"d6073341-870a-43f3-bb83-8c49d4df16bf":{"name":"first","slug":"first"},"38b95945-88e1-462b-9e8c-469766af5baf":{"name":"second","slug":"second"}},"en":[{"name":"english_first","slug":"english_first"}]}
Composer.lock
filament/filament: version: v3.2.121
filament/spatie-laravel-translatable-plugin: v3.3.0
repositories: https://github.com/lara-zeus/translatable
(I am using lara-zeus fork of filament-translatable
, because as I remember I have problems with file upload for different languages on the original filament-translatable
repo)
I have a repeater:
files
is in my model $translatable
fields
files
is cast as array 'files' => 'array',
All model translations works as expected but repeater not.10 replies
Changing language in ListItem does not translate the related records.
I have a translatable resource with EditResource page. I have some relations to this resource, also translatable. But when I am on the edit page of the resource and change language, the related resources stays listed in english. This is my relation in the form schema:
2 replies
Cannot search by table columns with same name but one is from relation
Hello I have a table with 2 columns First is the resource name, second is the related customer name. On both I have used
->searchable()
. So If I search by resource name the filter works but it works only for the resource name. Even if you comment out first column name
and try to search for customer it will continue search only for the resource name. SQL query does not change at all. Always search in the first column name
of the resource.
First column name
of the resource is json
but it think this is irrelevant for the issue.
If I change customer.name
to customer.phone
search starts working as usual for both fields.
Any ideas how to fix it?
Bonus Q: how you handle search in json fields, because it differs from normal fields (because of lower
) and this can lead to confusion when working with the product.5 replies