Total Complexity | 3 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
10 | class SkillCrudController extends CrudController |
||
11 | { |
||
12 | public function setup() |
||
13 | { |
||
14 | $this->crud->setModel("App\Models\Skill"); |
||
15 | $this->crud->setRoute("admin/skill"); |
||
16 | $this->crud->setEntityNameStrings('skill', 'skills'); |
||
17 | |||
18 | $this->crud->addColumn([ |
||
19 | 'name' => 'name', |
||
20 | 'type' => 'text', |
||
21 | 'label' => 'Name' |
||
22 | ]); |
||
23 | $this->crud->addColumn([ |
||
24 | 'name' => 'description', |
||
25 | 'type' => 'text', |
||
26 | 'label' => 'Description' |
||
27 | ]); |
||
28 | $this->crud->addColumn([ |
||
29 | 'name' => 'skill_type.name', |
||
30 | 'type' => 'text', |
||
31 | 'label' => 'Type' |
||
32 | ]); |
||
33 | |||
34 | $this->crud->addField([ |
||
35 | 'name' => 'name', |
||
36 | 'type' => 'text', |
||
37 | 'label' => "Name" |
||
38 | ]); |
||
39 | $this->crud->addField([ |
||
40 | 'name' => 'description', |
||
41 | 'type' => 'textarea', |
||
42 | 'label' => "Description" |
||
43 | ]); |
||
44 | $this->crud->addField([ |
||
45 | 'label' => "Type", |
||
46 | 'type' => 'select', |
||
47 | 'name' => 'skill_type_id', // the db column for the foreign key |
||
48 | 'entity' => 'skill_type', // the method that defines the relationship in your Model |
||
49 | 'attribute' => 'name', // foreign key attribute that is shown to user |
||
50 | ]); |
||
51 | } |
||
52 | |||
53 | public function store(StoreRequest $request) |
||
56 | } |
||
57 | |||
58 | public function update(UpdateRequest $request) |
||
63 |