D
D
Dmitry2021-01-23 19:23:18
Laravel
Dmitry, 2021-01-23 19:23:18

How to make additional settings for slug in Laravel?

I use cviebrock/eloquent-sluggable
in the project Russian letters it transliterates correctly. But here's the problem with other characters. Kazakh, for example, Ә, Ғ, Қ, Ң, Ө, Ұ Can you tell

me how and where to correct the scripts in order to set up transliteration of these letters as well?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alvvi, 2021-01-23
@liggth

There is a field "method"in the config where you can define your own Calalble for slug generation. Accordingly, by entering your generation method there, the generation will be completely in your hands.
See the signature here: https://github.com/cviebrock/eloquent-sluggable#method
Plugin default library: https://github.com/cocur/slugify , you can extend its method. Or you can even make a pull request to the library itself :)
You can also completely redefine the library engine, about it infa here: https://github.com/cviebrock/eloquent-sluggable#ex
... at your discretion. You can see how the standard Str::slug(). In my opinion, this is a slightly different topic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question