value($max)) { return; } return collect($value)->map(function ($name) use ($style) { $background = $this->formatStyle(Arr::get($style, $name, 'default')); return "$name"; })->implode(' '); // return collect($value)->map(function ($name) use ($class, $background) { // return "$name"; // })->implode(' '); } protected function formatStyle($style) { $background = 'style="background:#d2d6de;color: #555"'; if ($style !== 'default') { $style = Admin::color()->get($style); $background = "style='background:{$style}'"; } return $background; } protected function value($max) { $values = Helper::array($this->value); if ($max && count($values) > $max) { $values = array_slice($values, 0, $max); $values[] = '...'; } return $values; } }