| @@ 96-105 (lines=10) @@ | ||
| 93 | * |
|
| 94 | * @return $this |
|
| 95 | */ |
|
| 96 | public function disableView(bool $disable = true) |
|
| 97 | { |
|
| 98 | if ($disable) { |
|
| 99 | array_delete($this->default, Show::class); |
|
| 100 | } elseif (!in_array(Show::class, $this->default)) { |
|
| 101 | array_push($this->default, Show::class); |
|
| 102 | } |
|
| 103 | ||
| 104 | return $this; |
|
| 105 | } |
|
| 106 | ||
| 107 | /** |
|
| 108 | * Disable delete. |
|
| @@ 114-123 (lines=10) @@ | ||
| 111 | * |
|
| 112 | * @return $this. |
|
| 113 | */ |
|
| 114 | public function disableDelete(bool $disable = true) |
|
| 115 | { |
|
| 116 | if ($disable) { |
|
| 117 | array_delete($this->default, Delete::class); |
|
| 118 | } elseif (!in_array(Delete::class, $this->default)) { |
|
| 119 | array_push($this->default, Delete::class); |
|
| 120 | } |
|
| 121 | ||
| 122 | return $this; |
|
| 123 | } |
|
| 124 | ||
| 125 | /** |
|
| 126 | * Disable edit. |
|
| @@ 132-141 (lines=10) @@ | ||
| 129 | * |
|
| 130 | * @return $this |
|
| 131 | */ |
|
| 132 | public function disableEdit(bool $disable = true) |
|
| 133 | { |
|
| 134 | if ($disable) { |
|
| 135 | array_delete($this->default, Edit::class); |
|
| 136 | } elseif (!in_array(Edit::class, $this->default)) { |
|
| 137 | array_push($this->default, Edit::class); |
|
| 138 | } |
|
| 139 | ||
| 140 | return $this; |
|
| 141 | } |
|
| 142 | ||
| 143 | /** |
|
| 144 | * @param null|\Closure $callback |
|