| @@ 9-31 (lines=23) @@ | ||
| 6 | ||
| 7 | class LinkController extends CrudController { |
|
| 8 | ||
| 9 | public function all($entity) { |
|
| 10 | ||
| 11 | parent::all($entity); |
|
| 12 | ||
| 13 | $this->filter = \DataFilter::source(new Link()); |
|
| 14 | $this->filter->add('id', 'ID', 'text'); |
|
| 15 | $this->filter->add('display', 'Display', 'text'); |
|
| 16 | $this->filter->submit('search'); |
|
| 17 | $this->filter->reset('reset'); |
|
| 18 | $this->filter->build(); |
|
| 19 | ||
| 20 | $this->grid = \DataGrid::source($this->filter); |
|
| 21 | $this->grid->add('id', 'ID', true)->style("width:100px"); |
|
| 22 | $this->grid->add('display', 'Display'); |
|
| 23 | $this->grid->add('url', 'Model'); |
|
| 24 | $this->grid->add('show_menu','Show in Menu')->cell( function( $value, $row) { |
|
| 25 | return ($value) ? "True" : "False"; |
|
| 26 | }); |
|
| 27 | ||
| 28 | $this->addStylesToGrid(); |
|
| 29 | ||
| 30 | return $this->returnView(); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function edit($entity) { |
|
| 34 | ||
| @@ 9-30 (lines=22) @@ | ||
| 6 | ||
| 7 | class RoleController extends CrudController { |
|
| 8 | ||
| 9 | public function all($entity) { |
|
| 10 | ||
| 11 | parent::all($entity); |
|
| 12 | ||
| 13 | $this->filter = \DataFilter::source(Role::with('permissions')); |
|
| 14 | $this->filter->add('id', 'ID', 'text'); |
|
| 15 | $this->filter->add('name', 'Name', 'text'); |
|
| 16 | $this->filter->submit('search'); |
|
| 17 | $this->filter->reset('reset'); |
|
| 18 | $this->filter->build(); |
|
| 19 | ||
| 20 | $this->grid = \DataGrid::source($this->filter); |
|
| 21 | $this->grid->add('id', 'ID', true)->style("width:100px"); |
|
| 22 | $this->grid->add('name', 'Name')->style('width:100px'); |
|
| 23 | $this->grid->add('label', 'Description'); |
|
| 24 | $this->grid->add('{{ implode(", ", $permissions->pluck("name")->all()) }}', 'name' ); |
|
| 25 | ||
| 26 | ||
| 27 | $this->addStylesToGrid(); |
|
| 28 | ||
| 29 | return $this->returnView(); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function edit($entity) { |
|
| 33 | ||