Table Filter for Repeater Json Column

Hi guys.

I am having problems with the data saved by a repeater.
As the documentation says, I created a json column for the repeater and casted it to array in the model. Now I'm trying to create a filter on that column, but the
where
and whereJsonContains Eloquent methods don't seem to work.
I've also tried with raw SQL but it doesn't find any record.

Here's the content of the column:
"[
  {
    \"visibility_type\":\"Section Home Page\",
    \"visibility_time\":27,
    \"visibility_price\":233.84
  },
  {
    \"visibility_type\":\"Newsletter\",
    \"visibility_time\":21,
    \"visibility_price\":200.3
   }
]"


Am I doing something wrong? Thank you very much for your help and sorry for the stupid question.

In the images: my repeater code and the filter.
image.png
image.png
Solution
The error was caused by my test data: by using json_encode in the factory code, together with casting, the json was saved with the "".

Maybe it can be useful in the future for someone with a problem similar to mine 🥲
Was this page helpful?