| Total Complexity | 7 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class DeleteAction extends AbstractAction |
||
| 6 | { |
||
| 7 | protected $ident = 'delete'; |
||
| 8 | |||
| 9 | 2 | public function render($model = null) |
|
| 10 | { |
||
| 11 | 2 | $isVisible = parent::shouldRender($model); |
|
| 12 | 2 | if ($this->crud()->isSoftDeleteEnabled()) { |
|
| 13 | 1 | $isVisible = !$model->trashed(); |
|
| 14 | } |
||
| 15 | |||
| 16 | 2 | return view('jarboe::crud.actions.delete', [ |
|
| 17 | 2 | 'crud' => $this->crud(), |
|
| 18 | 2 | 'model' => $model, |
|
| 19 | 2 | 'isVisible' => $isVisible, |
|
| 20 | 2 | 'action' => $this, |
|
| 21 | ]); |
||
| 22 | } |
||
| 23 | |||
| 24 | 8 | public function isAllowed($model = null) |
|
| 32 | } |
||
| 33 | |||
| 34 | 2 | public function shouldRender($model = null) |
|
| 41 | } |
||
| 42 | } |
||
| 43 |