| 1 | <?php |
||
| 5 | class DeleteAction extends AbstractAction |
||
| 6 | { |
||
| 7 | protected $ident = 'delete'; |
||
| 8 | |||
| 9 | 2 | public function render($model = null) |
|
| 10 | { |
||
| 11 | 2 | $crud = $this->crud(); |
|
| 12 | 2 | $isVisible = parent::shouldRender($model); |
|
| 13 | 2 | if ($crud->isSoftDeleteEnabled()) { |
|
| 14 | 1 | $isVisible = !$model->trashed(); |
|
| 15 | } |
||
| 16 | |||
| 17 | 2 | return view('jarboe::crud.actions.delete', compact('crud', 'model', 'isVisible')); |
|
| 18 | } |
||
| 19 | |||
| 20 | 7 | public function isAllowed($model = null) |
|
| 29 | |||
| 30 | 2 | public function shouldRender($model = null) |
|
| 38 | } |
||
| 39 |