Closed thracefields closed 1 year ago
Take this file as an example : https://github.com/sebastienheyd/boilerplate/blob/master/src/Datatables/Admin/UsersDatatable.php
As you can see at line 19, I get the roles with the users. You have to do the same with books in your example.
After that, use the method data() to show the books name for example, see line 81
At last, only the main model is used for buttons, see line 103. If not, your datasource method certainly returns books instead of users.
If we have for example UsersDatatable.php, but the first column is from relationship - for example books, in the buttons as last field it will return the book id for route, not the user id. I think that it must be the model it uses as id source and ther order of the columns doesn't have to matter.