/** * Convert the model instance to an array. * * @return array */ public function toArray() { $attributes = parent::toArray(); if (isset($attributes['permissions'])) { $attributes['permissions'] = $this->getPermissionsAttribute($attributes['permissions']); } return $attributes; }
/** * Convert the model instance to an array. * * @return array */ public function toArray() { $result = parent::toArray(); if (isset($result['activated'])) { $result['activated'] = $this->getActivatedAttribute($result['activated']); } if (isset($result['permissions'])) { $result['permissions'] = $this->getPermissionsAttribute($result['permissions']); } if (isset($result['suspended_at'])) { $result['suspended_at'] = $result['suspended_at']->format('Y-m-d H:i:s'); } return $result; }
public function toArray() { return (array) \Locker\Helpers\Helpers::replaceHtmlEntity(parent::toArray()); }
/** * Convert the model instance to an array. * * @return array */ public function toArray() { $result = parent::toArray(); if (isset($result['suspended'])) { $result['suspended'] = $this->getSuspendedAttribute($result['suspended']); } if (isset($result['banned'])) { $result['banned'] = $this->getBannedAttribute($result['banned']); } if (isset($result['last_attempt_at']) and $result['last_attempt_at'] instanceof DateTime) { $result['last_attempt_at'] = $result['last_attempt_at']->format('Y-m-d H:i:s'); } if (isset($result['suspended_at']) and $result['suspended_at'] instanceof DateTime) { $result['suspended_at'] = $result['suspended_at']->format('Y-m-d H:i:s'); } return $result; }