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

SettingsDomain::updateSettings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

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