Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Feedback #24

Open
renalpha opened this issue Sep 15, 2020 · 2 comments
Open

Feedback #24

renalpha opened this issue Sep 15, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@renalpha
Copy link
Contributor

renalpha commented Sep 15, 2020

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.

@jamesdordoy jamesdordoy added the enhancement New feature or request label Sep 15, 2020
@jamesdordoy jamesdordoy self-assigned this Sep 15, 2020
@renalpha
Copy link
Contributor Author

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

@jamesdordoy
Copy link
Owner

@renalpha great thank you!

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

Thanks again

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants