PHPackages                             jeffersongoncalves/laravel-topic-normalizer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jeffersongoncalves/laravel-topic-normalizer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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.

v1.0.0(1mo ago)228MITPHP ^8.2

Since Jun 22Compare

[ Source](https://github.com/jeffersongoncalves/laravel-topic-normalizer)[ Packagist](https://packagist.org/packages/jeffersongoncalves/laravel-topic-normalizer)[ Docs](https://github.com/jeffersongoncalves/laravel-topic-normalizer)[ GitHub Sponsors](https://github.com/jeffersongoncalves)[ RSS](/packages/jeffersongoncalves-laravel-topic-normalizer/feed)WikiDiscussions Synced 2w ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

[![Laravel Topic Normalizer](https://raw.githubusercontent.com/jeffersongoncalves/laravel-topic-normalizer/master/art/jeffersongoncalves-laravel-topic-normalizer.png)](https://raw.githubusercontent.com/jeffersongoncalves/laravel-topic-normalizer/master/art/jeffersongoncalves-laravel-topic-normalizer.png)

Laravel Topic Normalizer
========================

[](#laravel-topic-normalizer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/64d24e638e329f434b84523fb95258e4273e4bfdc33aed7b0a416cd71ef4efa3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6566666572736f6e676f6e63616c7665732f6c61726176656c2d746f7069632d6e6f726d616c697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/laravel-topic-normalizer)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f583b3ad4188ea785a70334490b8fbb9b8f0d286cfa21136b69fba6d28790680/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6566666572736f6e676f6e63616c7665732f6c61726176656c2d746f7069632d6e6f726d616c697a65722f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/jeffersongoncalves/laravel-topic-normalizer/actions?query=workflow%3Arun-tests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/1cc0d586c133eb4a7babec7abf3954fba03a92b640f1e731a9012976329fd1be/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6566666572736f6e676f6e63616c7665732f6c61726176656c2d746f7069632d6e6f726d616c697a65722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d6173746572266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/jeffersongoncalves/laravel-topic-normalizer/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/8ea93625bddf237a703ff593c23b1cb8d10c4ce35e182076ea2b64baf822de8a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6566666572736f6e676f6e63616c7665732f6c61726176656c2d746f7069632d6e6f726d616c697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/laravel-topic-normalizer)

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
------------

[](#installation)

```
composer require jeffersongoncalves/laravel-topic-normalizer
```

Usage
-----

[](#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 out-of-range slugs dropped, duplicates removed (first occurrence wins, order preserved), and the result capped.

### Per-call overrides

[](#per-call-overrides)

The config defaults can be overridden per call with named arguments (each falls back to its config value):

```
$topics = TopicNormalizer::normalize(
    $repo['topics'] ?? [],
    $composer['keywords'] ?? [],
    max: 10,        // cap this call at 10
    maxLength: 30,  // drop slugs longer than 30 chars
    minLength: 2,   // drop single-character noise
);
```

`max_length` / `min_length` are accepted as snake\_case aliases. A `max` of `0` (or less) returns an empty list.

Configuration
-------------

[](#configuration)

```
php artisan vendor:publish --tag="topic-normalizer-config"
```

KeyDefaultDescription`max``20`Maximum number of topics returned (`0` or less returns nothing).`max_length``50`Slugs longer than this are dropped as junk.`min_length``0`Slugs shorter than this are dropped as junk (`0` disables the check).Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance90

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

45d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/411493?v=4)[Jefferson Gonçalves](/maintainers/jeffersongoncalves)[@jeffersongoncalves](https://github.com/jeffersongoncalves)

---

Tags

laraveljeffersongoncalveslaravel-topic-normalizer

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jeffersongoncalves-laravel-topic-normalizer/health.svg)

```
[![Health](https://phpackages.com/badges/jeffersongoncalves-laravel-topic-normalizer/health.svg)](https://phpackages.com/packages/jeffersongoncalves-laravel-topic-normalizer)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.4M352](/packages/psalm-plugin-laravel)[nativephp/mobile

NativePHP for Mobile

1.1k102.1k123](/packages/nativephp-mobile)[spatie/laravel-health

Monitor the health of a Laravel application

88212.7M180](/packages/spatie-laravel-health)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

24773.9k](/packages/harris21-laravel-fuse)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

817336.8k3](/packages/defstudio-telegraph)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329575.9k33](/packages/codewithdennis-filament-select-tree)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
