public function getAttributes($model, array $fields = null)
{
if (!is_object($model) && !is_array($model)) {
return [];
}
$attributes = $this->getDefaultAttributes($model);
static::$dispatcher->fire(new PrepareApiAttributes($this, $model, $attributes));
return $attributes;
}