Laravel Persian Slug Helper
- Copy Helpers.php to:
\app\Http
- Then in your
composer.json
add Helpers.php file location we just copied to autoload, for register it:
"autoload": { "files": [ "app/Http/Helpers.php" ], },
- Done.
For Example:
$title = 'تست @#$ شماره 123 aBCd';
$slug = Helpers::makeSlug($title);
/// $slug output is :
"تست-شماره-123-abcd"