forked from cachethq/cachet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSubscriberPresenter.php
46 lines (40 loc) · 1.14 KB
/
SubscriberPresenter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Presenters;
use CachetHQ\Cachet\Presenters\Traits\TimestampsTrait;
use CachetHQ\Cachet\Services\Dates\DateFactory;
use Illuminate\Contracts\Support\Arrayable;
use McCool\LaravelAutoPresenter\BasePresenter;
class SubscriberPresenter extends BasePresenter implements Arrayable
{
use TimestampsTrait;
/**
* Present formatted date time.
*
* @return string
*/
public function verified_at()
{
return ucfirst(app(DateFactory::class)->make($this->wrappedObject->verified_at)->format($this->incidentDateFormat()));
}
/**
* Convert the presenter instance to an array.
*
* @return string[]
*/
public function toArray()
{
return array_merge($this->wrappedObject->toArray(), [
'created_at' => $this->created_at(),
'updated_at' => $this->updated_at(),
'verified_at' => $this->verified_at(),
]);
}
}