Completed
Push — master ( b13bbf...5b16af )
by Denis
04:07
created

DestroyModel   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A destroy() 0 9 2
1
<?php
2
3
namespace Zendaemon\Services\Traits;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
trait DestroyModel
8
{
9
    public function destroy(Model $model): bool
10
    {
11
        try {
12
            $model->delete();
13
        } catch (\Exception $e) {
14
            return false;
15
        }
16
17
        return true;
18
    }
19
}