Simple, fluent Laravel 10 / 11 wrapper around the YEB Transliterator endpoint—convert Cyrillic, Greek, and other non-Latin text to Romanised output or various case/sluggified forms straight from your Laravel codebase.
- Features
- Requirements
- Installation
- Configuration
- Usage
- Options Reference
- Examples
- Troubleshooting
- Contributing
- License
- Zero-boilerplate – auto-discovered service provider & facade
- Supports Laravel 10 & 11 via
illuminate/support - One-line helper
TransliteratorAPI::transliterate()for every request - Easily publish & tweak default
config/transliterator.php - Sensible cURL defaults (timeout, JSON headers, UA string)
- Throws expressive
RuntimeExceptions on missing keys / API errors
| Minimum | |
|---|---|
| PHP | 8.1 |
| Laravel | 10.x / 11.x |
| YEB Account | Valid API key (YEB_KEY_ID) |
composer require yebto/laravel-transliterator-api
# (optional) publish the config so you can edit defaults
php artisan vendor:publish --tag=transliterator-config# .env
YEB_KEY_ID=****************************************
YEB_API_BASE=https://api.yeb.to/v1/ # override if self-hostingThe published config/transliterator.php lets you tune:
base_url– alternate endpoint- global cURL options (timeouts, headers, etc.)
use TransliteratorAPI;
// basic
$result = TransliteratorAPI::transliterate('bg', 'Дядовите чички');
/*
[
"lang" => "bg",
"type" => "plain",
"delimiter" => "-",
"original" => "Дядовите чички",
"result" => "Dyadovite chichki"
]
*/
// slug with custom delimiter
TransliteratorAPI::transliterate(
lang: 'ru',
text: 'Мой дядя самых честных правил',
type: 'slug',
delimiter: '_'
); // => "moy_dyadya_samykh_chestnykh_pravil"| Key | Allowed values | Default |
|---|---|---|
lang |
bg, ru, el, … (see YEB docs) |
— |
text |
Source string | — |
type |
plain, slug, snake, camel, capital, upper, lower |
plain |
delimiter |
Single character (only used when type = slug) |
- |
Route::post('/transliterator', function () {
return TransliteratorAPI::transliterate(
request('lang'),
request('text'),
request('type', 'plain'),
request('delimiter', '-')
);
});class GenerateFilename implements ShouldQueue
{
public function handle()
{
$slug = TransliteratorAPI::transliterate(
'el',
$this->originalTitle,
'slug'
)['result'];
// ...
}
}🎁 You can get 1,000+ free API requests by registering on yeb.to using your Google account.
Steps:
- Visit https://yeb.to
- Click Login with Google
- Retrieve your API key and add it to your
.envasYEB_KEY_ID
No credit card required!
If you encounter issues:
- Ensure your API key is correct and active
- Double-check that the config file is published
- Validate parameters against the API reference
- Check for typos in method names or required fields
- 📘 API Documentation: https://yeb.to/api/transliterator
- 📧 Email: support@yeb.to
- 🐛 Issues: GitHub Issues
© NETOX Ltd. Licensed under a proprietary or custom license unless stated otherwise in the repository.
💬 Have an idea, feature request, or want to suggest a new YouTube-related API? Reach out to us at support@yeb.to — we’d love to hear from you!