Skip to content
Advertisement

Laravel yajrabox relation sort

I have a project with laravel and datatable using yajrabox, it stuck in relationship sort

JavaScript

this is my kabupaten datatable class

JavaScript

and this is my action column.

provinsi model

JavaScript

and kabupaten model

JavaScript

my question are why $id in kabupaten.action return provinsi.id instead of kabupaten.id

and i have try

JavaScript

The $id return kabupaten.id but when I try to sort column, it said column provinsi.provinsi not found because the yajra not join my query.

If there anything wrong with my code.

Thanks

Advertisement

Answer

try changing eloquent ‘with’ to ‘join’ in query()

JavaScript

and add column

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement