blob: 27bd1fc442142beefbac4f21d60f62ca3ab02660 (
plain) (
blame)
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
|
<?php
/**
* Created by PhpStorm.
* User: camilstaps
* Date: 14-5-15
* Time: 10:47
*/
namespace CamilStaps\BotleaguesApi\Database;
use Carbon\Carbon;
class Model extends \Illuminate\Database\Eloquent\Model {
protected $date_format = Carbon::RFC2822;
protected function formatDate($date) {
return Carbon::parse($date)->format($this->date_format);
}
public function getCreatedAtAttribute($attr) {
return $this->formatDate($attr);
}
public function getUpdatedAtAttribute($attr) {
return $this->formatDate($attr);
}
}
|