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

DeleteModelHandler::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
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