File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff 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
185217DataTable 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+ ```
You can’t perform that action at this time.
0 commit comments