hasMany(Role::class); } public function users() { return $this->hasMany(User::class); } public function toJson($options = 0) { return parent::toJson($options); } public function __toString() { switch ($this->icon_type) { case 'fa': return ''; case 'img': case 'image': return '' . $this->icon . ''; default: return ''; } } }