Skip to content

Commit fe04900

Browse files
authored
Merge pull request yajra#3 from lk77/7.0
Update buttons-console documentation PR yajra#12
2 parents 305bdba + 78fce7d commit fe04900

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

buttons-console.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,38 @@ class PostsDataTable extends DataTable
180180
```
181181

182182

183+
### Model Namespace Option
184+
185+
In this example, we will pass a `--model-namespace` option to set the model namespace to be used by our DataTable.
186+
187+
```
188+
php artisan datatables:make Posts --model-namespace="Models\Client"
189+
```
190+
It will implicitly activate `--model` option and override the `model` parameter in `datatables-buttons` config file.
191+
This will allow to use a non-standard namespace if front-end and back-end models are in separate namespace for example.
192+
193+
194+
195+
### Action Option
196+
197+
In this example, we will pass a `--action` option to set a custom path for the action column view.
198+
199+
```
200+
php artisan datatables:make Posts --action="client.action"
201+
```
202+
If not provided, a default path will be used. It will needs to be changed thereafter.
203+
204+
### Columns Option
205+
206+
In this example, we will pass a `--columns` option to set the columns to be used by our DataTable.
207+
208+
```
209+
php artisan datatables:make Posts --columns="id,title,author"
210+
```
211+
If not provided, a default set of columns will be used. It will needs to be manually changed thereafter.
212+
213+
214+
183215
## Creating a DataTable Scope service class
184216

185217
DataTable scope is class that we can use to limit our database search results based on the defined query scopes.
@@ -208,4 +240,4 @@ class ActiveUser implements DataTableScopeContract
208240
return $query->where('active', true);
209241
}
210242
}
211-
```
243+
```

0 commit comments

Comments
 (0)