Completed
Push — master ( a2ea8b...2c4876 )
by Sherif
02:24
created

SettingsController::saveMany()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace App\Modules\V1\Core\Http\Controllers;
3
4
use Illuminate\Foundation\Http\FormRequest;
5
use App\Modules\V1\Core\Http\Controllers\BaseApiController;
6
use Illuminate\Http\Request;
7
8
9 View Code Duplication
class SettingsController extends BaseApiController
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    /**
12
     * The name of the model that is used by the base api controller 
13
     * to preform actions like (add, edit ... etc).
14
     * @var string
15
     */
16
    protected $model               = 'settings';
17
18
    /**
19
     * The validations rules used by the base api controller
20
     * to check before add.
21
     * @var array
22
     */
23
    protected $validationRules  = [
24
    'name'  => 'required|string|max:100',
25
    'value' => 'required|string'
26
    ];
27
    
28
    /**
29
     * Save list of settings.
30
     * 
31
     * @param  \Illuminate\Http\Request  $request
32
     * @return \Illuminate\Http\Response
33
     */
34
    public function saveMany(Request $request) 
35
    {   
36
        return \Response::json($this->repo->saveMany($request->all()), 200);
37
    }
38
}
39