pantagruel964 / laravel5-yandex-slug
Generate slug into translit in according to Yandex rules for Laravel 5
Installs: 298
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/pantagruel964/laravel5-yandex-slug
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2025-10-26 02:04:28 UTC
README
Laravel 5 has it's own function str_slug to revert cyrillic characters into translit. But it is not quite right for Yandex.
For example, if you make your URL like this: $slug = str_slug('ёлка') function return result elka. It's not good for SEO. Your URL won't be highlighted into the SERP:
The package makes slug characters in according to Yandex rules, in particular such characters as ё, щ, я, ю, ж, ц. As result Yandex will highlight keyword in URL into the SERP
Installation
composer require pantagruel964/laravel5-yandex-slug
After updating composer, add the service provider and facade in config/app.php
'providers' => [
...
Pantagruel964\Laravel5YandexSlug\SlugServiceProvider::class
...
]
'aliases' => [
...
'Slug' => Pantagruel964\Laravel5YandexSlug\Facades\Slug::class
...
]
Using
$slug = Slug::make('ёлка')
License
This package for Laravel is open-sourced software licensed under the MIT license