public function getFechaIniSuspensionAttribute($attribute) { $fecha_ini = ''; if ($attribute == '0000-00-00') { $attribute = null; } if (!is_null($attribute)) { if ($this->evento) { $partido = Partido::find($this->evento->partido_id); $fecha_ini = $this->partido->dia_partido; } else { $fecha_ini = $this->date_mysql_to_latino($attribute); } } return !is_null($fecha_ini) ? $fecha_ini : '0000-00-00'; }