Level 75
@liama Just change your format where you need it.
$date->format('Y-m-d H:i:s');
Or create accessor for it
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Project extends Model
{
/**
* Get the user's first name.
*
* @param string $value
* @return string
*/
public function getSerializeCreatedAtAttribute($value)
{
return $this->created_at->format('Y-m-d H:i:s');
}
}
After you can call it like
$project->serialize_created_at