Passed
Push — master ( 5a03f9...8e29e6 )
by Stephen
03:56 queued 01:10
created

DeleteModelHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
1
<?php
2
3
4
namespace Sfneal\CrudModelActions\Handlers;
5
6
7
use Exception;
8
use Illuminate\Database\Eloquent\Model;
9
10
trait DeleteModelHandler
11
{
12
    /**
13
     * Save or update the Model
14
     *
15
     * @return Model
16
     * @throws Exception
17
     */
18
    protected function handle(): Model
19
    {
20
        // Delete the Model
21
        $this->model->delete();
22
23
        // Return the Model
24
        return $this->model;
25
    }
26
}
27