blob: 27bd1fc442142beefbac4f21d60f62ca3ab02660 (
plain) (
tree)
|
|
<?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);
}
}
|