Passed
Push — master ( fabd45...a8694e )
by Ron
03:26 queued 11s
created

TechTips   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 8 1
1
<?php
2
3
namespace App\Http\Resources;
4
5
use Illuminate\Http\Resources\Json\JsonResource;
6
use Illuminate\Support\Str;
7
use Carbon\Carbon;
8
9
class TechTips extends JsonResource
10
{
11
    /**
12
     * Transform the resource into an array.
13
     *
14
     * @param  \Illuminate\Http\Request  $request
15
     * @return array
16
     */
17 6
    public function toArray($request)
18
    {
19
        return [
20 6
            'tip_id'       => $this->tip_id,
21 6
            'subject'      => $this->subject,
22 6
            'description'  => Str::words($this->description, 50),
23 6
            'created_at'   => Carbon::parse($this->created_at)->format('M d, Y'),
24 6
            'system_types' => $this->SystemTypes,
25
        ];
26
    }
27
}
28