Skip to content

Commit 4ec15a4

Browse files
committed
Revert "Rename Datatables to DataTables."
This reverts commit 46d912e.
1 parent 46d912e commit 4ec15a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+301
-301
lines changed

add-column.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ You can add a custom column on your response by using `addColumn` api.
66
## Add Column with Blade Syntax
77

88
```php
9-
use DataTables;
9+
use Datatables;
1010

1111
Route::get('user-data', function() {
1212
$model = App\User::query();
1313

14-
return DataTables::eloquent($model)
14+
return Datatables::eloquent($model)
1515
->addColumn('intro', 'Hi {{$name}}!')
1616
->make(true);
1717
});
@@ -21,12 +21,12 @@ Route::get('user-data', function() {
2121
## Add Column with Closure
2222

2323
```php
24-
use DataTables;
24+
use Datatables;
2525

2626
Route::get('user-data', function() {
2727
$model = App\User::query();
2828

29-
return DataTables::eloquent($model)
29+
return Datatables::eloquent($model)
3030
->addColumn('intro', function(User $user) {
3131
return 'Hi ' . $user->name . '!';
3232
})
@@ -40,18 +40,18 @@ Route::get('user-data', function() {
4040
> {tip} You can use view to render your added column by passing the view path as the second argument on `addColumn` api.
4141
4242
```php
43-
use DataTables;
43+
use Datatables;
4444

4545
Route::get('user-data', function() {
4646
$model = App\User::query();
4747

48-
return DataTables::eloquent($model)
49-
->addColumn('intro', 'users.DataTables.intro')
48+
return Datatables::eloquent($model)
49+
->addColumn('intro', 'users.datatables.intro')
5050
->make(true);
5151
});
5252
```
5353

54-
Then create your view on `resources/views/users/DataTables/intro.blade.php`.
54+
Then create your view on `resources/views/users/datatables/intro.blade.php`.
5555
```php
5656
Hi {{ $name }}!
5757
```
@@ -62,12 +62,12 @@ Hi {{ $name }}!
6262
> {tip} Just pass the column order as the third argument of `addColumn` api.
6363
6464
```php
65-
use DataTables;
65+
use Datatables;
6666

6767
Route::get('user-data', function() {
6868
$model = App\User::query();
6969

70-
return DataTables::eloquent($model)
70+
return Datatables::eloquent($model)
7171
->addColumn('intro', 'Hi {{$name}}!', 2)
7272
->make(true);
7373
});

blacklist.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
Sorting and searching will not work on columns explicitly defined as blacklisted.
44

55
```php
6-
use DataTables;
6+
use Datatables;
77

88
Route::get('user-data', function() {
99
$model = App\User::query();
1010

11-
return DataTables::eloquent($model)
11+
return Datatables::eloquent($model)
1212
->blacklist(['password', 'name'])
1313
->make(true);
1414
});
15-
```
15+
```

buttons-config.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<a name="console"></a>
44
## Artisan Console Configurations
5-
Namespace configuration is used by the DataTables command generator.
5+
Namespace configuration is used by the datatables command generator.
66

77
```php
88
'namespace' => [
@@ -16,7 +16,7 @@ This is the base namespace/directory to be created when a new DataTable was call
1616
This directory is appended on default Laravel namespace.
1717

1818
**Usage:**
19-
```php artisan DataTables:make User```
19+
```php artisan datatables:make User```
2020

2121
**Output:**
2222
```App\DataTables\UserDataTable```
@@ -26,7 +26,7 @@ This directory is appended on default Laravel namespace.
2626
### Model Option
2727
This is the base namespace/directory where your model's are located.
2828
This directory is appended on default Laravel namespace.
29-
**Usage:** ```php artisan DataTables:make Post --model```
29+
**Usage:** ```php artisan datatables:make Post --model```
3030
**Output:** ```App\DataTables\PostDataTable```
3131
**With Model:** ```App\Post``
3232
**Export filename:** ```posts_(timestamp)```

buttons-console.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ php artisan list
1515
In this example, we will create a DataTable service class.
1616

1717
```
18-
php artisan DataTables:make Posts
18+
php artisan datatables:make Posts
1919
```
2020

2121
This will create an `PostsDataTable` class on `app\DataTables` directory.
@@ -24,24 +24,24 @@ This will create an `PostsDataTable` class on `app\DataTables` directory.
2424
namespace App\DataTables;
2525

2626
use App\User;
27-
use Yajra\DataTables\Services\DataTable;
27+
use Yajra\Datatables\Services\DataTable;
2828

2929
class PostsDataTable extends DataTable
3030
{
3131
/**
3232
* Build DataTable class.
3333
*
34-
* @return \Yajra\DataTables\Engines\BaseEngine
34+
* @return \Yajra\Datatables\Engines\BaseEngine
3535
*/
3636
public function dataTable()
3737
{
38-
return $this->DataTables
38+
return $this->datatables
3939
->eloquent($this->query())
4040
->addColumn('action', 'path.to.action.view');
4141
}
4242

4343
/**
44-
* Get the query object to be processed by DataTables.
44+
* Get the query object to be processed by dataTables.
4545
*
4646
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Support\Collection
4747
*/
@@ -55,7 +55,7 @@ class PostsDataTable extends DataTable
5555
/**
5656
* Optional method if you want to use html builder.
5757
*
58-
* @return \Yajra\DataTables\Html\Builder
58+
* @return \Yajra\Datatables\Html\Builder
5959
*/
6060
public function html()
6161
{
@@ -98,7 +98,7 @@ class PostsDataTable extends DataTable
9898
In this example, we will pass a `--model` option to set the model to be used by our DataTable.
9999

100100
```
101-
php artisan DataTables:make Posts --model
101+
php artisan datatables:make Posts --model
102102
```
103103

104104
This will generate a `App\DataTables\PostsDataTable` class that uses `App\Post` as the base model for our query.
@@ -110,24 +110,24 @@ The exported filename will also be set to `posts_(timestamp)`.
110110
namespace App\DataTables;
111111

112112
use App\Post;
113-
use Yajra\DataTables\Services\DataTable;
113+
use Yajra\Datatables\Services\DataTable;
114114

115115
class PostsDataTable extends DataTable
116116
{
117117
/**
118118
* Build DataTable class.
119119
*
120-
* @return \Yajra\DataTables\Engines\BaseEngine
120+
* @return \Yajra\Datatables\Engines\BaseEngine
121121
*/
122122
public function dataTable()
123123
{
124-
return $this->DataTables
124+
return $this->datatables
125125
->eloquent($this->query())
126126
->addColumn('action', 'path.to.action.view');
127127
}
128128

129129
/**
130-
* Get the query object to be processed by DataTables.
130+
* Get the query object to be processed by dataTables.
131131
*
132132
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Support\Collection
133133
*/
@@ -141,7 +141,7 @@ class PostsDataTable extends DataTable
141141
/**
142142
* Optional method if you want to use html builder.
143143
*
144-
* @return \Yajra\DataTables\Html\Builder
144+
* @return \Yajra\Datatables\Html\Builder
145145
*/
146146
public function html()
147147
{
@@ -185,9 +185,9 @@ class PostsDataTable extends DataTable
185185
In this example, we will pass a `--model-namespace` option to set the model namespace to be used by our DataTable.
186186

187187
```
188-
php artisan DataTables:make Posts --model-namespace="Models\Client"
188+
php artisan datatables:make Posts --model-namespace="Models\Client"
189189
```
190-
It will implicitly activate `--model` option and override the `model` parameter in `DataTables-buttons` config file.
190+
It will implicitly activate `--model` option and override the `model` parameter in `datatables-buttons` config file.
191191
This will allow to use a non-standard namespace if front-end and back-end models are in separate namespace for example.
192192

193193

@@ -197,7 +197,7 @@ This will allow to use a non-standard namespace if front-end and back-end models
197197
In this example, we will pass a `--action` option to set a custom path for the action column view.
198198

199199
```
200-
php artisan DataTables:make Posts --action="client.action"
200+
php artisan datatables:make Posts --action="client.action"
201201
```
202202
If not provided, a default path will be used. It will needs to be changed thereafter.
203203

@@ -206,7 +206,7 @@ If not provided, a default path will be used. It will needs to be changed therea
206206
In this example, we will pass a `--columns` option to set the columns to be used by our DataTable.
207207

208208
```
209-
php artisan DataTables:make Posts --columns="id,title,author"
209+
php artisan datatables:make Posts --columns="id,title,author"
210210
```
211211
If not provided, a default set of columns will be used. It will needs to be manually changed thereafter.
212212

@@ -217,17 +217,17 @@ If not provided, a default set of columns will be used. It will needs to be manu
217217
DataTable scope is class that we can use to limit our database search results based on the defined query scopes.
218218

219219
```
220-
php artisan DataTables:scope ActiveUser
220+
php artisan datatables:scope ActiveUser
221221
```
222222

223223
This will create an `ActiveUser` class on `app\DataTables\Scopes` directory.
224224

225225
```php
226226
namespace App\DataTables\Scopes;
227227

228-
use Yajra\DataTables\Contracts\DataTablescopeContract;
228+
use Yajra\Datatables\Contracts\DataTableScopeContract;
229229

230-
class ActiveUser implements DataTablescopeContract
230+
class ActiveUser implements DataTableScopeContract
231231
{
232232
/**
233233
* Apply a query scope.

buttons-custom.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ request) and enabling a `myCustomAction`.
1111
namespace App\DataTables;
1212

1313
use App\User;
14-
use Yajra\DataTables\Services\DataTable;
14+
use Yajra\Datatables\Services\DataTable;
1515

1616
class UsersDataTable extends DataTable
1717
{
@@ -35,4 +35,4 @@ class UsersDataTable extends DataTable
3535
}
3636
```
3737

38-
Take a look at `Yajra\DataTables\Services\DataTable` to see how to fetch and manipulate the data (functions `excel`, `csv`, `pdf`).
38+
Take a look at `Yajra\Datatables\Services\DataTable` to see how to fetch and manipulate the data (functions `excel`, `csv`, `pdf`).

buttons-export.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Export button group includes `excel`, `csv` and `pdf` button.
1010
namespace App\DataTables;
1111

1212
use App\User;
13-
use Yajra\DataTables\Services\DataTable;
13+
use Yajra\Datatables\Services\DataTable;
1414

1515
class UsersDataTable extends DataTable
1616
{
@@ -36,7 +36,7 @@ To enable exporting to excel, set `excel` on the buttons array.
3636
namespace App\DataTables;
3737

3838
use App\User;
39-
use Yajra\DataTables\Services\DataTable;
39+
use Yajra\Datatables\Services\DataTable;
4040

4141
class UsersDataTable extends DataTable
4242
{
@@ -62,7 +62,7 @@ To enable exporting to csv, set `csv` on the buttons array.
6262
namespace App\DataTables;
6363

6464
use App\User;
65-
use Yajra\DataTables\Services\DataTable;
65+
use Yajra\Datatables\Services\DataTable;
6666

6767
class UsersDataTable extends DataTable
6868
{
@@ -88,7 +88,7 @@ To enable exporting to pdf, set `pdf` on the buttons array.
8888
namespace App\DataTables;
8989

9090
use App\User;
91-
use Yajra\DataTables\Services\DataTable;
91+
use Yajra\Datatables\Services\DataTable;
9292

9393
class UsersDataTable extends DataTable
9494
{
@@ -114,7 +114,7 @@ To enable print button, set `print` on the buttons array.
114114
namespace App\DataTables;
115115

116116
use App\User;
117-
use Yajra\DataTables\Services\DataTable;
117+
use Yajra\Datatables\Services\DataTable;
118118

119119
class UsersDataTable extends DataTable
120120
{
@@ -140,7 +140,7 @@ To enable reset button, set `reset` on the buttons array.
140140
namespace App\DataTables;
141141

142142
use App\User;
143-
use Yajra\DataTables\Services\DataTable;
143+
use Yajra\Datatables\Services\DataTable;
144144

145145
class UsersDataTable extends DataTable
146146
{
@@ -166,7 +166,7 @@ To enable reload button, set `reload` on the buttons array.
166166
namespace App\DataTables;
167167

168168
use App\User;
169-
use Yajra\DataTables\Services\DataTable;
169+
use Yajra\Datatables\Services\DataTable;
170170

171171
class UsersDataTable extends DataTable
172172
{

buttons-extended.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ We can now extend and reuse our DataTable class inside our controller by using `
66
77

88
## Upgrading from v1.0 to v1.1
9-
- Upgrade to `laravel-DataTables-buttons:^1.1`
9+
- Upgrade to `laravel-datatables-buttons:^1.1`
1010
- Rename `ajax()` method to `dataTable()`
1111
- Remove `->make(true)` from the method chain.
1212

1313
```php
1414
public function ajax()
1515
{
16-
return $this->DataTables
16+
return $this->datatables
1717
->eloquent($this->query())
1818
->addColumn('action', 'path.to.action.view')
1919
->make(true)
@@ -26,7 +26,7 @@ TO
2626
```php
2727
public function dataTable()
2828
{
29-
return $this->DataTables
29+
return $this->datatables
3030
->eloquent($this->query())
3131
->addColumn('action', 'path.to.action.view');
3232
}
@@ -35,15 +35,15 @@ TO
3535
## Quick Example:
3636
```php
3737
Route::get('datatable', function(RolesDataTable $dataTable){
38-
return $dataTable->before(function (\Yajra\DataTables\Engines\BaseEngine $dataTable) {
38+
return $dataTable->before(function (\Yajra\Datatables\Engines\BaseEngine $dataTable) {
3939
return $dataTable->addColumn('test', 'added inside controller');
4040
})
4141
->response(function (\Illuminate\Support\Collection $response) {
4242
$response['test'] = 'Append Data';
4343

4444
return $response;
4545
})
46-
->withHtml(function(\Yajra\DataTables\Html\Builder $builder) {
46+
->withHtml(function(\Yajra\Datatables\Html\Builder $builder) {
4747
$builder->columns(['id', 'name', 'etc...']);
4848
})
4949
->with('key', 'value')

0 commit comments

Comments
 (0)