format('d.m.Y.'); } public function setStartDateAttribute($value) { $this->attributes['start_date'] = Carbon::createFromFormat('d.m.Y.', $value); } public function getEndDateAttribute($value) { return Carbon::parse($value)->format('d.m.Y.'); } public function setEndDateAttribute($value) { $this->attributes['end_date'] = Carbon::createFromFormat('d.m.Y.', $value); } /** * Get the event's id number * * @return int */ public function getId() { return $this->id; } /** * Get the event's title * * @return string */ public function getTitle() { return $this->name; } /** * Is it an all day event? * * @return bool */ public function isAllDay() { return true; } /** * Get the start time * * @return DateTime */ public function getStart() { return Carbon::createFromFormat('d.m.Y.', $this->start_date); } /** * Get the end time * * @return DateTime */ public function getEnd() { return Carbon::createFromFormat('d.m.Y.', $this->end_date); } }