Passed
Push — dev5a ( 01b7fe...d46f4b )
by Ron
07:10
created

SettingsDomain::updateSettings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

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 0
cts 6
cp 0
crap 2
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
    public function updateSettings($key, $value)
13
    {
14
        Settings::firstOrCreate(
15
            ['key' => $key],
16
            ['key' => $key, 'value' => $value]
17
        )->update(['value' => $value]);
18
        return true;
19
    }
20
}
21