Completed
Push — master ( 2d22de...e2d103 )
by Sherif
02:14
created

Setting::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Modules\Core\Http\Resources;
4
5
use Illuminate\Http\Resources\Json\JsonResource;
6
7 View Code Duplication
class Setting extends JsonResource
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...
8
{
9
    /**
10
     * Indicates if the resource's collection keys should be preserved.
11
     *
12
     * @var bool
13
     */
14
    public $preserveKeys = true;
15
16
    /**
17
     * Transform the resource into an array.
18
     *
19
     * @param  \Illuminate\Http\Request  $request
20
     * @return array
21
     */
22
    public function toArray($request)
23
    {
24
        return [
25
            'id' => $this->id,
26
            'name' => $this->name,
27
            'value' => $this->value,
28
            'key' => $this->key,
29
            'createdAt' => $this->created_at,
30
            'updatedAt' => $this->updated_at,
31
        ];
32
    }
33
}
34