Reputation: 79
I am having trying to retrive created at date from datebase on edit form: in database saved in timestamp format. how to retrive date in custom format
{{ Form::text('project_start', Input::old('name'), array('class' => 'form-control')) }}
Upvotes: 0
Views: 596
Reputation: 48711
You can define an Accessor method in your related model class:
public function getCreatedAtAttribute($value)
{
return date("Y/m/d", strtotime($value));
}
More on documentations
Upvotes: 1