laravel-datatables icon indicating copy to clipboard operation
laravel-datatables copied to clipboard

custom engines in datatables.php config dont work

Open redati opened this issue 9 months ago • 3 comments

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 avatar Apr 28 '24 00:04 redati

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

redati avatar Apr 28 '24 14:04 redati

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

yajra avatar Apr 29 '24 08:04 yajra

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);
}

redati avatar Apr 29 '24 12:04 redati

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[bot] avatar May 30 '24 00:05 github-actions[bot]

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

github-actions[bot] avatar Jun 07 '24 00:06 github-actions[bot]