Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
3 / 3 |
Breadcrumb | |
100.00% |
1 / 1 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
3 / 3 |
getValueAttribute | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
getTextAttribute | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
serializeDate | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
1 | <?php |
2 | |
3 | namespace Qmp\Laravel\SiteGeneratorDetail\Models; |
4 | |
5 | use Illuminate\Database\Eloquent\Model; |
6 | |
7 | class Breadcrumb extends Model |
8 | { |
9 | protected $connection = 'siteGeneratorSites'; |
10 | protected $table = 'breadcrumbs'; |
11 | protected $appends = ['value', 'text']; |
12 | protected $hidden = ['id', 'name']; |
13 | protected $fillable = ['id', 'name']; |
14 | |
15 | public function getValueAttribute() |
16 | { |
17 | return $this->attributes['id']; |
18 | } |
19 | |
20 | public function getTextAttribute() |
21 | { |
22 | return ucfirst($this->attributes['name']); |
23 | } |
24 | |
25 | /** |
26 | * Prepare a date for array / JSON serialization. |
27 | * |
28 | * @param \DateTimeInterface $date |
29 | * @return string |
30 | */ |
31 | protected function serializeDate(\DateTimeInterface $date) |
32 | { |
33 | return $date->format('Y-m-d H:i:s'); |
34 | } |
35 | |
36 | } |