Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom engines in datatables.php config dont work #3139

Closed
redati opened this issue Apr 28, 2024 · 5 comments
Closed

custom engines in datatables.php config dont work #3139

redati opened this issue Apr 28, 2024 · 5 comments

Comments

@redati
Copy link

redati commented Apr 28, 2024

Summary of problem or feature request

custom engines in datatables.php config dont work

Code snippet of problem

no need, The setting is just ignored and not used.

System details

Latest package and latest laravel

  • ubuntu
  • 8.3
  • 11
  • 11
@redati
Copy link
Author

redati commented Apr 28, 2024

my temporary fix
$loader = AliasLoader::getInstance();
$loader->alias(QueryDataTable::class, RedatiQueryDataTable::class);

@yajra
Copy link
Owner

yajra commented Apr 29, 2024

Can you please provide snippets to reproduce the issue? thanks!

@redati
Copy link
Author

redati commented Apr 29, 2024

yes, in new instalation

all steps https://yajrabox.com/docs/laravel-datatables/10.0/quick-starter

php artisan vendor:publish --tag=datatables

cp vendor/yajra/laravel-datatables-oracle/src/QueryDataTable.php app/

changue namespace namespace to App;

changue config/datatables to and use use Yajra\DataTables\DataTableAbstract.

'query' => App\QueryDataTable::class,

in App\QueryDataTable::class add " dd(config('datatables.engines.query'));" in construct or modify anything but it will not be reflected in the application

this method is not being called.

vendor/yajra/laravel-datatables-oracle/src/DataTables.php

/**
* DataTables using query builder.
*
* @throws \Yajra\DataTables\Exceptions\Exception
/
public function query(QueryBuilder $builder): QueryDataTable
{
/
* @var string $dataTable */
$dataTable = config('datatables.engines.query');

    $this->validateDataTable($dataTable, QueryDataTable::class);

    return $dataTable::create($builder);
}

Copy link

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label May 30, 2024
Copy link

github-actions bot commented Jun 7, 2024

This issue was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this as completed Jun 7, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants