public static function trasnlateToModels($tags) { array_walk($tags, function (&$tag) { $tag = Tag::firstOrCreate(['name' => $tag]); }); return $tags; }
public static function trasnlateToModels($categories) { array_walk($categories, function (&$category) { $category = Tag::firstOrCreate(['name' => $category]); }); return $categories; }