],
];
+ /**
+ * @return string
+ */
public function getTitleAttribute()
{
- return $this->start_date;
+ return $this->start_date->format('d/m/Y');
}
+ /**
+ * @return Carbon
+ */
public function getEndDateAttribute(): Carbon
{
return $this->start_date->addWeek();
}
+ public function getUrlAttribute()
+ {
+ return route('agenda.show', ['agenda' => $this->id]);
+ }
+
+
+
+ public function nextWeekUrl()
+ {
+ return ($a = self::find($this->id + 1)) === null ?
+ null :
+ $a->url;
+ }
+
+ public function lastWeekUrl()
+ {
+ return ($a = self::find($this->id - 1)) === null ?
+ null :
+ $a->url;
+ }
}