@@ -15,7 +15,7 @@ php artisan list
15
15
In this example, we will create a DataTable service class.
16
16
17
17
```
18
- php artisan DataTables :make Posts
18
+ php artisan datatables :make Posts
19
19
```
20
20
21
21
This will create an ` PostsDataTable ` class on ` app\DataTables ` directory.
@@ -24,24 +24,24 @@ This will create an `PostsDataTable` class on `app\DataTables` directory.
24
24
namespace App\DataTables;
25
25
26
26
use App\User;
27
- use Yajra\DataTables \Services\DataTable;
27
+ use Yajra\Datatables \Services\DataTable;
28
28
29
29
class PostsDataTable extends DataTable
30
30
{
31
31
/**
32
32
* Build DataTable class.
33
33
*
34
- * @return \Yajra\DataTables \Engines\BaseEngine
34
+ * @return \Yajra\Datatables \Engines\BaseEngine
35
35
*/
36
36
public function dataTable()
37
37
{
38
- return $this->DataTables
38
+ return $this->datatables
39
39
->eloquent($this->query())
40
40
->addColumn('action', 'path.to.action.view');
41
41
}
42
42
43
43
/**
44
- * Get the query object to be processed by DataTables .
44
+ * Get the query object to be processed by dataTables .
45
45
*
46
46
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Support\Collection
47
47
*/
@@ -55,7 +55,7 @@ class PostsDataTable extends DataTable
55
55
/**
56
56
* Optional method if you want to use html builder.
57
57
*
58
- * @return \Yajra\DataTables \Html\Builder
58
+ * @return \Yajra\Datatables \Html\Builder
59
59
*/
60
60
public function html()
61
61
{
@@ -98,7 +98,7 @@ class PostsDataTable extends DataTable
98
98
In this example, we will pass a ` --model ` option to set the model to be used by our DataTable.
99
99
100
100
```
101
- php artisan DataTables :make Posts --model
101
+ php artisan datatables :make Posts --model
102
102
```
103
103
104
104
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)`.
110
110
namespace App\DataTables;
111
111
112
112
use App\Post;
113
- use Yajra\DataTables \Services\DataTable;
113
+ use Yajra\Datatables \Services\DataTable;
114
114
115
115
class PostsDataTable extends DataTable
116
116
{
117
117
/**
118
118
* Build DataTable class.
119
119
*
120
- * @return \Yajra\DataTables \Engines\BaseEngine
120
+ * @return \Yajra\Datatables \Engines\BaseEngine
121
121
*/
122
122
public function dataTable()
123
123
{
124
- return $this->DataTables
124
+ return $this->datatables
125
125
->eloquent($this->query())
126
126
->addColumn('action', 'path.to.action.view');
127
127
}
128
128
129
129
/**
130
- * Get the query object to be processed by DataTables .
130
+ * Get the query object to be processed by dataTables .
131
131
*
132
132
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Support\Collection
133
133
*/
@@ -141,7 +141,7 @@ class PostsDataTable extends DataTable
141
141
/**
142
142
* Optional method if you want to use html builder.
143
143
*
144
- * @return \Yajra\DataTables \Html\Builder
144
+ * @return \Yajra\Datatables \Html\Builder
145
145
*/
146
146
public function html()
147
147
{
@@ -185,9 +185,9 @@ class PostsDataTable extends DataTable
185
185
In this example, we will pass a ` --model-namespace ` option to set the model namespace to be used by our DataTable.
186
186
187
187
```
188
- php artisan DataTables :make Posts --model-namespace="Models\Client"
188
+ php artisan datatables :make Posts --model-namespace="Models\Client"
189
189
```
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.
191
191
This will allow to use a non-standard namespace if front-end and back-end models are in separate namespace for example.
192
192
193
193
@@ -197,7 +197,7 @@ This will allow to use a non-standard namespace if front-end and back-end models
197
197
In this example, we will pass a ` --action ` option to set a custom path for the action column view.
198
198
199
199
```
200
- php artisan DataTables :make Posts --action="client.action"
200
+ php artisan datatables :make Posts --action="client.action"
201
201
```
202
202
If not provided, a default path will be used. It will needs to be changed thereafter.
203
203
@@ -206,7 +206,7 @@ If not provided, a default path will be used. It will needs to be changed therea
206
206
In this example, we will pass a ` --columns ` option to set the columns to be used by our DataTable.
207
207
208
208
```
209
- php artisan DataTables :make Posts --columns="id,title,author"
209
+ php artisan datatables :make Posts --columns="id,title,author"
210
210
```
211
211
If not provided, a default set of columns will be used. It will needs to be manually changed thereafter.
212
212
@@ -217,17 +217,17 @@ If not provided, a default set of columns will be used. It will needs to be manu
217
217
DataTable scope is class that we can use to limit our database search results based on the defined query scopes.
218
218
219
219
```
220
- php artisan DataTables :scope ActiveUser
220
+ php artisan datatables :scope ActiveUser
221
221
```
222
222
223
223
This will create an ` ActiveUser ` class on ` app\DataTables\Scopes ` directory.
224
224
225
225
``` php
226
226
namespace App\DataTables\Scopes;
227
227
228
- use Yajra\DataTables \Contracts\DataTablescopeContract ;
228
+ use Yajra\Datatables \Contracts\DataTableScopeContract ;
229
229
230
- class ActiveUser implements DataTablescopeContract
230
+ class ActiveUser implements DataTableScopeContract
231
231
{
232
232
/**
233
233
* Apply a query scope.
0 commit comments