Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
4 / 4 |
Domain | |
100.00% |
1 / 1 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
4 / 4 |
getValueAttribute | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
getTextAttribute | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
getDataURLAttribute | |
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 Domain extends Model |
8 | { |
9 | protected $connection = 'siteGeneratorSites'; |
10 | protected $table = 'domains'; |
11 | protected $appends = ['value', 'text', 'dataURL']; |
12 | protected $hidden = ['id', 'domain', 'logo']; |
13 | |
14 | public function getValueAttribute() |
15 | { |
16 | return $this->attributes['id']; |
17 | } |
18 | |
19 | public function getTextAttribute() |
20 | { |
21 | return $this->attributes['domain']; |
22 | } |
23 | |
24 | public function getDataURLAttribute() |
25 | { |
26 | return $this->attributes['logo']; |
27 | } |
28 | |
29 | /** |
30 | * Prepare a date for array / JSON serialization. |
31 | * |
32 | * @param \DateTimeInterface $date |
33 | * @return string |
34 | */ |
35 | protected function serializeDate(\DateTimeInterface $date) |
36 | { |
37 | return $date->format('Y-m-d H:i:s'); |
38 | } |
39 | |
40 | } |