Parameters does not exist Yajra Datatable Laravel

1.4k Views Asked by At
return DataTables::of($data)->addIndexColumn()->parameters([
                'dom'          => 'Bfrtip',
                'buttons'      => ['export', 'print', 'reset', 'reload'],
          ])
                ->make(true);

Yajra Datatable Buttons not working as expected. If I remove the parameters method then it works fine and the data is also shown in the view. But if I try adding the parameters for the buttons it gives the below error:

exception: "BadMethodCallException"
file: "/Users/amzenex/Desktop/cm-admin/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php"
line: 103
message: "Method Yajra\\DataTables\\CollectionDataTable::parameters does not exist."

I have installed the yajra/laravel-datatables-buttons 4.13 version and yajra/laravel-datatables-oracle 9.18.

"require": {
        "php": "^7.2.5",
        "algolia/algoliasearch-client-php": "^2.7",
        "algolia/scout-extended": "^1.10",
        "consoletvs/charts": "6.*",
        "erusev/parsedown": "^1.7",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^6.3",
        "laravel/framework": "^7.24",
        "laravel/scout": "^8.4",
        "laravel/tinker": "^2.0",
        "laravelcollective/html": "^6.2",
        "maatwebsite/excel": "^3.1",
        "phpoffice/phpspreadsheet": "^1.8",
        "proengsoft/laravel-jsvalidation": "^4.3",
        "realrashid/sweet-alert": "^3.2",
        "spatie/laravel-permission": "^4.0",
        "yajra/laravel-datatables-buttons": "^4.13",
        "yajra/laravel-datatables-oracle": "^9.18"
    }

I have also added it in the app.php:

Yajra\Datatables\DatatablesServiceProvider::class,
        Yajra\DataTables\ButtonsServiceProvider::class

I not able to figure out where the problem is. Any help or information would be really appreciated.

0

There are 0 best solutions below