Passed
Push — master ( c7007b...6716c0 )
by Quim González
04:47
created

Task::toArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 8
nc 2
nop 0
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Task extends Model
8
{
9
    protected $fillable = ['name', 'user_id', 'description'];
10
11
    public function toArray()
12
    {
13
        return [
14
            'id' => $this->id,
15
            'name' => $this->name,
16
            'description' => $this->description,
17
            'user_id' => $this->user_id,
18
            'completed' => $this->completed? true:false,
19
            'created_at' => $this->created_at."",
20
            'updated_at' => $this->updated_at."",
21
        ];
22
    }
23
}
24