Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
2 / 2 |
SegmentationOffersSponsors | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
2 / 2 |
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 SegmentationOffersSponsors extends Model |
8 | { |
9 | protected $connection = 'siteGeneratorSites'; |
10 | protected $table = 'segmentation_offers_sponsors'; |
11 | protected $appends = ['text']; |
12 | protected $hidden = ['id','name']; |
13 | |
14 | public function getTextAttribute() |
15 | { |
16 | return ucfirst($this->attributes['name']); |
17 | } |
18 | |
19 | /** |
20 | * Prepare a date for array / JSON serialization. |
21 | * |
22 | * @param \DateTimeInterface $date |
23 | * @return string |
24 | */ |
25 | protected function serializeDate(\DateTimeInterface $date) |
26 | { |
27 | return $date->format('Y-m-d H:i:s'); |
28 | } |
29 | |
30 | } |