定制 jeffersongoncalves/laravel-topic-normalizer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jeffersongoncalves/laravel-topic-normalizer

Composer 安装命令:

composer require jeffersongoncalves/laravel-topic-normalizer

包简介

A tiny Laravel helper that merges raw topic/keyword lists (GitHub topics, composer.json + package.json keywords, Packagist keywords, …) into one slugged, deduplicated, length-filtered and capped list.

README 文档

README

Laravel Topic Normalizer

Laravel Topic Normalizer

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Merge raw topic / keyword lists from several sources — GitHub topics, composer.json + package.json keywords, Packagist keywords — into one clean list: slugged, deduplicated, length-filtered and capped.

Installation

composer require jeffersongoncalves/laravel-topic-normalizer

Usage

use JeffersonGoncalves\TopicNormalizer\TopicNormalizer;

$topics = TopicNormalizer::normalize(
    $repo['topics'] ?? [],          // GitHub topics
    $composer['keywords'] ?? [],    // composer.json
    $packageJson['keywords'] ?? [], // package.json
);
// => ['laravel', 'filament', 'php-package', …]  (slugged, unique, max 20)

Pass any number of lists. Non-strings are skipped; values are Str::slug()-ed, empties and over-long slugs dropped, duplicates removed, and the result capped.

Configuration

php artisan vendor:publish --tag="topic-normalizer-config"
Key Default Description
max 20 Maximum number of topics returned.
max_length 50 Slugs longer than this are dropped as junk.

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-22