Skip to content

Commit 747fa9d

Browse files
committed
Add upgrade guide.
1 parent f5b8f48 commit 747fa9d

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

buttons-extended.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22

33
We can now extend and reuse our DataTable class inside our controller by using `before` and `response` callback.
44

5+
> IMPORTANT: Extended DataTable is only applicable on `^1.1` and above.
6+
7+
8+
## Upgrading from v1.0 to v1.1
9+
- Upgrade to `laravel-datatables-buttons:^1.1`
10+
- Rename `ajax()` method to `dataTable()`
11+
- Remove `->make(true)` from the method chain.
12+
13+
```php
14+
public function ajax()
15+
{
16+
return $this->datatables
17+
->eloquent($this->query())
18+
->addColumn('action', 'path.to.action.view')
19+
->make(true)
20+
}
21+
```
22+
23+
TO
24+
25+
26+
```php
27+
public function dataTable()
28+
{
29+
return $this->datatables
30+
->eloquent($this->query())
31+
->addColumn('action', 'path.to.action.view');
32+
}
33+
```
34+
535
## Quick Example:
636
```php
737
Route::get('datatable', function(RolesDataTable $dataTable){
@@ -14,4 +44,3 @@ Route::get('datatable', function(RolesDataTable $dataTable){
1444
})->render('path.to.view');
1545
});
1646
```
17-

0 commit comments

Comments
 (0)