Laravel-Vue-Datatable_Laravel-Package icon indicating copy to clipboard operation
Laravel-Vue-Datatable_Laravel-Package copied to clipboard

Feedback

Open renalpha opened this issue 4 years ago • 2 comments

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.

renalpha avatar Sep 15 '20 04:09 renalpha

Already done some work, tried to PR.. Feel free to cherry-pick. https://github.com/renalpha/Laravel-Vue-Datatable_Laravel-Package

renalpha avatar Sep 16 '20 07:09 renalpha

@renalpha great thank you!

Ill have a look at your branch and cherry pick accordingly.

Thanks again

jamesdordoy avatar Sep 16 '20 10:09 jamesdordoy