K
K
kkoshakk2015-11-18 15:03:39
Laravel
kkoshakk, 2015-11-18 15:03:39

Laravel 5.1 Slug?

Good afternoon, as I understand it, laravel 5.1 has the ability to generate a slug from Cyrillic using standard tools. I have a model with the names of settlements, how to form a slug through the model and store it in the MySQL database and how to add indexes to the field?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gregory, 2015-11-19
@difiso

Indexes are added via migration when creating a field: here it says .
The slug is added like this: $model->slug = str_slug($name,'-');
You can also use the mutator .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question