Passed
Push — dev5 ( c3531a...a24f56 )
by Ron
08:14
created

DestroyCustomer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A softDelete() 0 9 1
1
<?php
2
3
namespace App\Domains\Customers;
4
5
use Illuminate\Support\Facades\Log;
6
use Illuminate\Support\Facades\Auth;
7
8
use App\Customers;
9
use App\CustomerFavs;
10
11
class DestroyCustomer
12
{
13 2
    public function softDelete($custID)
14
    {
15
        //  Remove the customer from any users favorites
16 2
        CustomerFavs::where('cust_id', $custID)->delete();
17
        //  Disable the customer
18 2
        Customers::destroy($custID);
19
20 2
        Log::notice('User - '.Auth::user()->full_name.' has deactivated Customer ID '.$custID);
21 2
        return true;
22
    }
23
}
24