Skip to content

Commit 108ded2

Browse files
authored
Update crud-controller.stub
1 parent 33e9b6c commit 108ded2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Console/stubs/crud-controller.stub

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ class DummyClassCrudController extends CrudController {
4242
// $this->crud->removeColumns(['column_name_1', 'column_name_2']); // remove an array of columns from the stack
4343
// $this->crud->setColumnDetails('column_name', ['attribute' => 'value']); // adjusts the properties of the passed in column (by name)
4444
// $this->crud->setColumnsDetails(['column_1', 'column_2'], ['attribute' => 'value']);
45+
46+
// ------ CRUD BUTTONS
47+
// possible positions: 'beginning' and 'end'; defaults to 'beginning' for the 'line' stack, 'end' for the others;
48+
// $this->crud->addButton($stack, $name, $type, $content, $position); // add a button; possible types are: view, model_function
49+
// $this->crud->addButtonFromModelFunction($stack, $name, $model_function_name, $position); // add a button whose HTML is returned by a method in the CRUD model
50+
// $this->crud->addButtonFromView($stack, $name, $view, $position); // add a button whose HTML is in a view placed at resources\views\vendor\backpack\crud\buttons
51+
// $this->crud->removeButton($name);
52+
// $this->crud->removeButtonFromStack($name, $stack);
4553

4654
// ------ CRUD ACCESS
4755
// $this->crud->allowAccess(['list', 'create', 'update', 'reorder', 'delete']);
@@ -56,11 +64,22 @@ class DummyClassCrudController extends CrudController {
5664
// NOTE: you also need to do allow access to the right users: $this->crud->allowAccess('details_row');
5765
// NOTE: you also need to do overwrite the showDetailsRow($id) method in your EntityCrudController to show whatever you'd like in the details row OR overwrite the views/backpack/crud/details_row.blade.php
5866

67+
// ------ REVISIONS
68+
// You also need to use \Venturecraft\Revisionable\RevisionableTrait;
69+
// Please check out: https://laravel-backpack.readme.io/docs/crud#revisions
70+
// $this->crud->allowAccess('revisions');
71+
5972
// ------ AJAX TABLE VIEW
6073
// Please note the drawbacks of this though:
6174
// - 1-n and n-n columns are not searchable
6275
// - date and datetime columns won't be sortable anymore
6376
// $this->crud->enableAjaxTable();
77+
78+
79+
// ------ DATATABLE EXPORT BUTTONS
80+
// Show export to PDF, CSV, XLS and Print buttons on the table view.
81+
// Does not work well with AJAX datatables.
82+
// $this->crud->enableExportButtons();
6483

6584
// ------ ADVANCED QUERIES
6685
// $this->crud->addClause('active');

0 commit comments

Comments
 (0)