kostasch/greeklish

Convert Greek text to greeklish (latin) and generate URL friendly slugs for Laravel.

Maintainers

Package info

github.com/kostasxyz/greeklish

pkg:composer/kostasch/greeklish

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 8

Open Issues: 1

v1.0.1 2026-05-28 19:34 UTC

This package is auto-updated.

Last update: 2026-05-28 19:36:01 UTC


README

Convert Greek text to latin characters and generate clean, URL-friendly slugs for Laravel.

Vowels follow the ELOT 743 / ISO 843 letter-preserving rules (αι→ai, ει→ei, οι→oi, υι→yi, υ→y), with the αυ/ευ/ηυ voicing rules (αυτός → aftos, ευρώ → evro), accent and diaeresis stripping, and guillemet removal. Greek names transcribe as on a passport — Αικατερίνη → aikaterini, Ειρήνη → eirini, Οικονόμου → oikonomou.

Requirements

  • PHP 8.3+
  • Laravel 12 or 13

Installation

composer require kostasch/greeklish

The service provider and the Greeklish facade are registered automatically through Laravel package discovery — no configuration required.

Usage

use Kostasch\Greeklish\Facades\Greeklish;

Greeklish::make('Γεια σου Κόσμε');   // "geia sou kosme"
Greeklish::text('Γεια σου Κόσμε');   // "geia sou kosme"
Greeklish::slug('Γεια σου Κόσμε');   // "geia-sou-kosme"

make()

Raw transliteration of Greek to latin, leaving spacing and punctuation in place.

Greeklish::make('Καλημέρα!'); // "kalimera!"

text()

Transliteration with optional stripping of short words.

Greeklish::text('ο σκύλος μου');           // "o skylos mou"
Greeklish::text('ο σκύλος μου', true);      // "skylos mou"  (drops one-letter words)
Greeklish::text('το σπίτι', false, true);   // "spiti"       (drops two-letter words)

slug()

Builds a URL-friendly slug. stopOne defaults to true, so one-letter words are dropped.

Greeklish::slug('Άρθρο για την Ελλάδα'); // "arthro-gia-tin-ellada"
Greeklish::slug('ο σκύλος μου');          // "skylos-mou"
Greeklish::slug('ο σκύλος μου', false);   // "o-skylos-mou"

Without the facade

The class is bound in the container and can be resolved or injected directly:

use Kostasch\Greeklish\Greeklish;

public function store(Greeklish $greeklish): void
{
    $slug = $greeklish->slug($request->title);
}

Testing

composer test

License

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