Laravel-Vue-Datatable_Laravel-Package
Laravel-Vue-Datatable_Laravel-Package copied to clipboard
Feedback
Hey man. I love your package.
I was wondering. I dont think you need the relationship query.
` $query = User::query();
$query->join('contacts', 'users.id', '=', 'contacts.user_id');
$query->eloquentQuery($orderBy, $orderByDir, $searchValue);
`
`
/** @var \bool[][] */
protected $dataTableColumns = [
'users.id' => [
'searchable' => false,
'orderable' => true,
],
'name' => [
'searchable' => true,
'orderable' => true,
],
'users.email' => [
'searchable' => true,
'orderable' => true,
],
'active' => [
'orderable' => true,
],
'users.created_at' => [
'searchable' => true,
'orderable' => true,
],
'contacts.company' => [
'searchable' => true,
'orderable' => true,
],
];
`
This works for filtering etc etc . Everything seems to work perfectly fine.
The only thing is. This would require to remove all $model->getTable()
references in the code. But it makes life easy.
Already done some work, tried to PR.. Feel free to cherry-pick. https://github.com/renalpha/Laravel-Vue-Datatable_Laravel-Package
@renalpha great thank you!
Ill have a look at your branch and cherry pick accordingly.
Thanks again