LibraryResource   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 12 1
1
<?php
2
3
namespace App\Http\Resources;
4
5
use Illuminate\Http\Resources\Json\JsonResource;
6
7
class LibraryResource extends JsonResource
8
{
9
    /**
10
     * Transform the resource into an array.
11
     *
12
     * @param  \Illuminate\Http\Request  $request
13
     * @return array
14
     */
15
    public function toArray($request)
16
    {
17
        return [
18
            'type' => 'library',
19
            'id' => $this->id,
0 ignored issues
show
Bug Best Practice introduced by
The property id does not exist on App\Http\Resources\LibraryResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
20
            'name' => [
21
                'nob' => $this->name,
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist on App\Http\Resources\LibraryResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
22
                'nno' => $this->name,
23
                'eng' => $this->name_eng,
0 ignored issues
show
Bug Best Practice introduced by
The property name_eng does not exist on App\Http\Resources\LibraryResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
24
            ],
25
            'created_at' => $this->created_at->toDateTimeString(),
0 ignored issues
show
Bug Best Practice introduced by
The property created_at does not exist on App\Http\Resources\LibraryResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
26
            'updated_at' => $this->updated_at->toDateTimeString(),
0 ignored issues
show
Bug Best Practice introduced by
The property updated_at does not exist on App\Http\Resources\LibraryResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
27
        ];
28
    }
29
}
30