public function setCodeAttribute($code) { $code = trim($code); $this->attributes['code'] = $code; if (strlen($code)) { $this->fileName = $code . '.yaml'; } return $this; }