| Total Complexity | 4 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class ClassificationCrudController extends CrudController |
||
| 10 | { |
||
| 11 | use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation; |
||
|
|
|||
| 12 | use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation; |
||
| 13 | use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Prepare the admin interface by setting the associated |
||
| 17 | * model, setting the route, and adding custom columns/fields. |
||
| 18 | * |
||
| 19 | * @return void |
||
| 20 | */ |
||
| 21 | public function setup() : void |
||
| 22 | { |
||
| 23 | // Eloquent model to associate with this collection of views and controller actions. |
||
| 24 | $this->crud->setModel('App\Models\Classification'); |
||
| 25 | // Custom backpack route. |
||
| 26 | $this->crud->setRoute('admin/classification'); |
||
| 27 | // Custom strings to display within the backpack UI. |
||
| 28 | $this->crud->setEntityNameStrings('classification', 'classifications'); |
||
| 29 | |||
| 30 | $this->crud->operation(['create', 'update'], function () { |
||
| 31 | $this->crud->addField([ |
||
| 32 | 'name' => 'key', |
||
| 33 | 'type' => 'text', |
||
| 34 | 'label' => 'Key', |
||
| 35 | ]); |
||
| 36 | }); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function setupListOperation() |
||
|
1 ignored issue
–
show
|
|||
| 40 | { |
||
| 41 | $this->crud->addColumn([ |
||
| 42 | 'name' => 'id', |
||
| 43 | 'type' => 'text', |
||
| 44 | 'label' => 'ID', |
||
| 45 | ]); |
||
| 46 | |||
| 47 | $this->crud->addColumn([ |
||
| 48 | 'name' => 'key', |
||
| 49 | 'type' => 'text', |
||
| 50 | 'label' => 'Key', |
||
| 51 | ]); |
||
| 52 | } |
||
| 53 | |||
| 54 | public function setupCreateOperation() |
||
| 57 | } |
||
| 58 | |||
| 59 | public function setupUpdateOperation() |
||
| 64 |