Now in this article, i will teach you how to solve Call to undefined function str_slug() in any laravel application. So now you will find a best solution of Call to undefined function str_slug() in laravel 8 application.
str_slug() generate sluggify url from any given string. If there are any spaces or any special character in string that is not good for user friendly URL then it removed all these spaces and special character from the string.
$exampleSlug = Str::slug('Example of str slug'); dd($exampleSlug);
But we want to use it on helpers functions then we need to install new composer package by using command as bellow:
composer require laravel/helpers
Now you can use helper function as like bellow:
$exampleSlug = str_slug('Example of str Slug'); dd($exampleSlug);
Read Also : Laravel 8 User Roles and Permissions Tutorial
Thanks for read. I hope it help you. For more you can follow us on facebook