diff --git a/buttons-custom.md b/buttons-custom.md index 0f178ca..089a318 100644 --- a/buttons-custom.md +++ b/buttons-custom.md @@ -15,7 +15,7 @@ use Yajra\DataTables\Services\DataTable; class UsersDataTable extends DataTable { - protected $actions = ['print', 'excel', 'myCustomAction']; + protected array $actions = ['print', 'excel', 'myCustomAction']; public function html() { diff --git a/buttons-fast-excel.md b/buttons-fast-excel.md index fa04177..4d0819e 100644 --- a/buttons-fast-excel.md +++ b/buttons-fast-excel.md @@ -9,14 +9,14 @@ FastExcel integration uses cursor behind the scene thus eager loaded columns wil ## Usage 1. Install `fast-excel` using `composer require rap2hpoutre/fast-excel`. -2. Create a dataTable class `php artisan datatables:make Users` +2. Create a dataTable class `php artisan datatables:make Users`. 3. Adjust `UsersDataTable` as needed. 4. Set property `$fastExcel = true`. ```php class UsersDataTable extends DataTable { - protected $fastExcel = true; + protected bool $fastExcel = true; ... } @@ -32,12 +32,12 @@ class UsersDataTable extends DataTable ```php class UsersDataTable extends DataTable { - protected $fastExcel = true; - protected $fastExcelCallback = false; + protected bool $fastExcel = true; + protected bool $fastExcelCallback = false; ``` -2. Exported file will now be based on how your query was structured. No header formatting and all selected columns in sql will be included in the output. +2. The exported file will now be based on your query's structure. No header formatting and all selected columns in sql will be included in the output. ## Using custom callback @@ -46,9 +46,9 @@ Just override the `fastExcelCallback` method: ```php class UsersDataTable extends DataTable { - protected $fastExcel = true; + protected bool $fastExcel = true; - public function fastExcelCallback() + public function fastExcelCallback() \Closure { return function ($row) { return [ @@ -59,4 +59,4 @@ class UsersDataTable extends DataTable } ... -``` \ No newline at end of file +``` diff --git a/buttons-installation.md b/buttons-installation.md index 839f35b..b6aec3e 100644 --- a/buttons-installation.md +++ b/buttons-installation.md @@ -7,8 +7,8 @@ A Laravel DataTables plugin for handling server-side exporting of table as csv, Run the following command in your project to get the latest version of the plugin: -```shell -composer require yajra/laravel-datatables-buttons:^9.0 +```bash +composer require yajra/laravel-datatables-buttons:"^12.0" ``` @@ -28,6 +28,6 @@ Open the file ```config/app.php``` and then add following service provider. After completing the step above, use the following command to publish configuration & assets: -```shell +```bash php artisan vendor:publish --tag=datatables-buttons ``` diff --git a/editor-installation.md b/editor-installation.md index c4c95b6..7bed304 100644 --- a/editor-installation.md +++ b/editor-installation.md @@ -11,14 +11,16 @@ A [premium license](https://editor.datatables.net/purchase/index) is required to Run the following command in your project to get the latest version of the plugin: -`composer require yajra/laravel-datatables-editor:^1.0` +```bash +composer require yajra/laravel-datatables-editor:"^12.0" +``` ## Configuration > This step is optional if you are using Laravel 5.5 -Open the file ```config/app.php``` and then add following service provider. +Open the file ```config/app.php``` and then add the following service provider. ```php 'providers' => [ diff --git a/engine-query.md b/engine-query.md index e800e53..700e6e9 100644 --- a/engine-query.md +++ b/engine-query.md @@ -27,7 +27,7 @@ use DataTables; Route::get('user-data', function() { $query = DB::table('users'); - return DataTables::queryBuilder($query)->toJson(); + return DataTables::query($query)->toJson(); }); ``` @@ -41,7 +41,7 @@ use Yajra\DataTables\DataTables; Route::get('user-data', function(DataTables $dataTables) { $query = DB::table('users'); - return $dataTables->queryBuilder($query)->toJson(); + return $dataTables->query($query)->toJson(); }); ``` @@ -53,7 +53,7 @@ use DB; Route::get('user-data', function() { $query = DB::table('users'); - return app('datatables')->queryBuilder($query)->toJson(); + return app('datatables')->query($query)->toJson(); }); ``` diff --git a/exports-installation.md b/exports-installation.md index 79dd9fa..59afb4e 100644 --- a/exports-installation.md +++ b/exports-installation.md @@ -7,7 +7,7 @@ This package is a plugin of Laravel DataTables for handling server-side exportin ## Quick Installation ``` -composer require yajra/laravel-datatables-export -W +composer require yajra/laravel-datatables-export:"^12.0" ``` The package also requires batch job: @@ -27,4 +27,4 @@ Yajra\DataTables\ExportServiceProvider::class ``` $ php artisan vendor:publish --tag=datatables-export --force -``` \ No newline at end of file +``` diff --git a/fractal-installation.md b/fractal-installation.md index e210f6b..e717b4d 100644 --- a/fractal-installation.md +++ b/fractal-installation.md @@ -4,7 +4,9 @@ Github: https://github.com/yajra/laravel-datatables-fractal Run the following command in your project to get the latest version of the plugin: -`composer require yajra/laravel-datatables-fractal:^9.0` +```bash +composer require yajra/laravel-datatables-fractal:"^12.0" +``` ## Configuration > This step is optional if you are using Laravel 5.5 diff --git a/html-installation.md b/html-installation.md index 507ce61..534ac95 100644 --- a/html-installation.md +++ b/html-installation.md @@ -6,7 +6,9 @@ Github: https://github.com/yajra/laravel-datatables-html Run the following command in your project to get the latest version of the plugin: -`composer require yajra/laravel-datatables-html:^9.0` +```bash +composer require yajra/laravel-datatables-html:"^12.0" +``` ## Configuration diff --git a/installation.md b/installation.md index e24f5c0..8be648b 100644 --- a/installation.md +++ b/installation.md @@ -11,8 +11,8 @@ ### Requirements -- [Laravel 9|10](https://github.com/laravel/framework) -- [jQuery DataTables v1.10.x](http://datatables.net/) +- [Laravel 12](https://github.com/laravel/framework) +- [DataTables 1.x|2.x](http://datatables.net/) ### Installing Laravel DataTables @@ -22,28 +22,20 @@ Laravel DataTables can be installed with [Composer](http://getcomposer.org/doc/0 Run the following command in your project to get the latest version of the package: ```bash -composer require yajra/laravel-datatables-oracle:"^10.0" +composer require yajra/laravel-datatables-oracle:"^12.0" ``` -If you are using most of the DataTables plugins like Buttons & Html, you can alternatively use the all-in-one installer package. - -#### Laravel 9 +If you use most of the DataTables plugins like Buttons & HTML, you can use the all-in-one installer package. ```bash -composer require yajra/laravel-datatables:"^9.0" -``` - -#### Laravel 10 - -```bash -composer require yajra/laravel-datatables:^10.0 +composer require yajra/laravel-datatables:"^12.0" ``` ### Configuration > This step is optional if you are using Laravel 5.5+ -Open the file ```config/app.php``` and then add following service provider. +Open the file ```config/app.php``` or ```bootstrap/providers.php``` for Laravel 12 then add following service provider. ```php 'providers' => [ @@ -54,7 +46,7 @@ Open the file ```config/app.php``` and then add following service provider. After completing the step above, use the following command to publish configuration & assets: -``` +```bash php artisan vendor:publish --tag=datatables ``` diff --git a/row-options.md b/row-options.md index 11c975e..50b0a5d 100644 --- a/row-options.md +++ b/row-options.md @@ -49,7 +49,7 @@ Setting row class via `blade` string. ## Row Data -Setting row class via `closure`. +Setting row data via `closure`. ```php ->setRowData([ @@ -62,7 +62,7 @@ Setting row class via `closure`. ]) ``` -Setting row class via `blade` string. +Setting row data via `blade` string. ```php ->setRowData([ @@ -74,7 +74,7 @@ Setting row class via `blade` string. ## Row Attributes -Setting row class via `closure`. +Setting row attribute via `closure`. ```php ->setRowAttr([ @@ -84,10 +84,10 @@ Setting row class via `closure`. ]) ``` -Setting row class via `blade` string. +Setting row attribute via `blade` string. ```php ->setRowAttr([ 'color' => '{{$color}}', ]) -``` \ No newline at end of file +```