'required', 'suffix' => 'required', 'display_chart' => 'boolean', ]; protected $fillable = ['name', 'suffix', 'description', 'display_chart']; /** * Determines whether a chart should be shown. * @return bool */ public function getShouldDisplayAttribute() { return $this->display_chart === 1; } /** * Get the transformer instance. * * @return ComponentTransformer */ public function getTransformer() { return new MetricTransformer(); } }