0

Trying to use Yajra DataTables as service implementation and here is my problem:

I have JSON column metas I building table columns based on fields inside that column, for excample:

[ 'data' => 'date', 'name' => 'metas->date AS date', 'title' => 'Data' ],

So inside metas I have:

{
    "date": "2018-09-17",
}

When I try to return this to DataTable it will leave quotas, or escape it with backslash. So the output looks like:

"Something" or "Something \"mmm?\ whatever!" but should be jus Something.

Tried ->escapeColumns(false) and ->rawColumns(['date']) and ->rawColumns(['metas->date']) and many more...

Response looks like this:

{"draw":1,"recordsTotal":77,"recordsFiltered":77,"data":[{"id":43695,"nr":"18-036","date":"\"2018-09-17\""...

As you can see I have additional quotes in response near date: Normally if I return same data from DB with ->toJson() there wouldn't be problem. There is something wrong with DataTables decoding.

RomkaLTU
  • 3,683
  • 8
  • 40
  • 63

0 Answers0