Passed
Push — dev5a ( d46f4b...f24c41 )
by Ron
07:14
created

SettingsDomain   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateSettings() 0 7 1
1
<?php
2
3
namespace App\Domains\Admin;
4
5
use App\Settings;
6
use Illuminate\Support\Facades\Auth;
7
use Illuminate\Support\Facades\Log;
8
9
10
class SettingsDomain
11
{
12 6
    public function updateSettings($key, $value)
13
    {
14 6
        Settings::firstOrCreate(
15 6
            ['key' => $key],
16 6
            ['key' => $key, 'value' => $value]
17 6
        )->update(['value' => $value]);
18 6
        return true;
19
    }
20
}
21