PHP code example of jeffersongoncalves / laravel-topic-normalizer
1. Go to this page and download the library: Download jeffersongoncalves/laravel-topic-normalizer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jeffersongoncalves / laravel-topic-normalizer example snippets
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)
$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
);
bash
php artisan vendor:publish --tag="topic-normalizer-config"