Joe
Joe
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
Thanks to @awcodes the issue got sorted after raising the case as an issue in filament repo. here is the link to solution: https://github.com/filamentphp/filament/issues/9033#event-10646961042
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
No description
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
If that helps too, I've been working on a project with the same requirements for language switcher and it's working but that's filament 2 not 3
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
I tried removing the relationship and adding the options via - options() only but it returned an error saying categories doesn't exist, I changed it to category_id , but still no luck
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
If this helps, it mostly occurs with options that are generated by a relationship, like for example, the picture is for a table of services and being filtered by categories, they are connected via many-to-many relationship and relationship("categories","title") is added
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
No description
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
I really want to thank you for the time that you've given and being patient with me 🙏
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
I tried changing json to array and it was the same outcome
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
Category
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
and btw, these values are the "en" key values of each row so it's a perfect response, but when i remove the dump it prints the data as json again!
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
No description
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
but there is an interesting thing happening here
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
No description
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
I adjusted your code to be the below and the error was gone, but still giving the same outcome:
->relationship('categories', 'title', modifyQueryUsing: function (Builder $query) {
$locale = app()->currentLocale();
$query->each(fn ($category) => $category->title
->{$locale});
})
->relationship('categories', 'title', modifyQueryUsing: function (Builder $query) {
$locale = app()->currentLocale();
$query->each(fn ($category) => $category->title
->{$locale});
})
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
No description
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
As an update, this what've reached to:
->relationship('categories', 'title', modifyQueryUsing: function (Builder $query) {
$query->each(fn ($category) => $category->title = json_decode($category->title, true));
})
->relationship('categories', 'title', modifyQueryUsing: function (Builder $query) {
$query->each(fn ($category) => $category->title = json_decode($category->title, true));
})
but yet still giving the same outcome for some reason despite the fact that when i run dd() it shows the correct outcome
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
by modifying query you mean modify it in ->options() or ->relationship() ? because i tried using options() and didn't work while relationships could figure out how as it kept giving out errors
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
Is there any sort of workaround that i can do to make it work? I tried all the available options and it doesn't seem to work 😓
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
I think that's correct, due to the fact that the CategoryResource shows the data as it should be and even has the availability to switch between languages when the translatable plugin is used.
35 replies
FFilament
Created by Joe on 9/5/2023 in #❓┊help
JSON columns issue
No description
35 replies