public function hasMultiSelectValue($relation, $value_string) { foreach ($this->{$relation} as $item) { if ($item->name == $value_string) { return true; } } return false; }