-
-
Notifications
You must be signed in to change notification settings - Fork 459
customizeSlugEngine
Shipu Ahamed edited this page Sep 3, 2016
·
1 revision
/**
* @param \Cocur\Slugify\Slugify $engine
* @param string $attribute
* @return \Cocur\Slugify\Slugify
*/
public function customizeSlugEngine(Slugify $engine, $attribute)
{
...
}
If this method exists on your model, the Slugify engine can be customized before slugging occurs. This might be where you change the character mappings that are used, or alter language files, etc..
You can customize the engine on a per-model and per-attribute basis (maybe your model has two slug fields, and one of them needs customization).
Take a look at tests/Models/PostWithCustomEngine.php
for an example.