| Total Complexity | 4 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait SoftDeletesRepository |
||
| 6 | { |
||
| 7 | public function restore(int $id): bool |
||
| 8 | { |
||
| 9 | return $this->getNewBuilderWithScope()->where('id', $id)->restore(); |
||
|
|
|||
| 10 | } |
||
| 11 | |||
| 12 | public function forceDelete(int $id): bool |
||
| 13 | { |
||
| 14 | return $this->getNewBuilderWithScope()->where('id', $id)->forceDelete(); |
||
| 15 | } |
||
| 16 | |||
| 17 | public function onlyTrash(): self |
||
| 18 | { |
||
| 19 | $this->scope(fn (Builder $builder) => $builder->onlyTrash()); |
||
| 20 | |||
| 21 | return $this; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function withTrash(): self |
||
| 29 | } |
||
| 30 | } |
||
| 31 |