1π
β
In your model
class MyModel extends Model
{
/**
* Get created_at in date format ==> 1975-12-25
*
* @param string $value
* @return string
*/
public function getCreatedAtDateAttribute($value)
{
return $this->created_at->toDateString();
}
}
then
var labels = {!! $object->pluck('created_at_date') !!};
Source:stackexchange.com