Completed
Push — master ( 8023d3...8b2ccd )
by Sherif
10:04
created

SettingController::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Modules\Core\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
use App\Modules\Core\BaseClasses\BaseApiController;
7
use App\Modules\Core\Services\SettingService;
8
use App\Modules\Core\Http\Resources\General as GeneralResource;
9
10
class SettingController extends BaseApiController
11
{
12
    /**
13
     * Path of the sotre form request.
14
     *
15
     * @var string
16
     */
17
    protected $storeFormRequest = 'App\Modules\Core\Http\Requests\StoreSetting';
18
19
    /**
20
     * Path of the model resource
21
     *
22
     * @var string
23
     */
24
    protected $modelResource = 'App\Modules\Core\Http\Resources\Setting';
25
26
    /**
27
     * Init new object.
28
     *
29
     * @param   SettingService $service
30
     * @return  void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
31
     */
32
    public function __construct(SettingService $service)
33
    {
34
        parent::__construct($service);
35
    }
36
37
    /**
38
     * Save list of settings.
39
     *
40
     * @param Request $request
41
     * @return \Illuminate\Http\Response
42
     */
43
    public function saveMany(Request $request)
44
    {
45
        return new GeneralResource($this->service->saveMany($request->all()));
46
    }
47
}
48