'Название', 'type' => 'Тип', 'hours_count' => 'Количество часов', 'date_start' => 'Дата начала', 'date_end' => 'Дата окончания', 'place' => 'Место', 'event_format' => 'Формат', 'description' => 'Описание', 'additional_info' => 'Дополнительная информация', 'status' => 'Статус', ]; } /** * @return string[] */ public static function getStatus(): array { return [ self::DISABLE_STATUS => "Не активный", self::ACTIVE_STATUS => "Активный", ]; } public function contacts(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(EventContact::class); } /** * @throws \Exception */ public function getDateStartFormatedAttribute(): string { $startDate = new DateTime($this->date_start); return $startDate->format("d-m-Y"); } /** * @throws \Exception */ public function getDateStartFormatedToFormAttribute(): string { $startDate = new DateTime($this->date_start); return $startDate->format("Y-m-d"); } /** * @throws \Exception */ public function getDateEndFormatedAttribute(): string { $endDate = new DateTime($this->date_end); return $endDate->format("d-m-Y"); } /** * @throws \Exception */ public function getDateEndFormatedToFormAttribute(): string { $endDate = new DateTime($this->date_end); return $endDate->format("Y-m-d"); } }