mardi 18 février 2020

Laravel and Arabic Slugs

when creating a slug from a name . the slug is in English letters example :

name = مقالة جديدة

slug = mk-l-gdyd

it should be: مقالة-جديدة

Any idea how to solve this issue?

i'm using this package

Model

class Post extends Model
{
    use HasSlug;

protected $primarykey='id';

protected $fillable = [
    'title', 'slug', 'body',
];

protected $dates = [
    'created_at','updated_at'
];

public function getSlugOptions() : SlugOptions
{
    return SlugOptions::create()
        ->generateSlugsFrom('title')
        ->saveSlugsTo('slug');
}

}


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2uVIUNk
via IFTTT

Aucun commentaire:

Enregistrer un commentaire