Call to undefined function str_slug() in Laravel
In this example i will show you solve laravel Call to undefined function str_slug(). you will find solution of Call to undefined function str_slug() in laravel 6 application.
str_slug() generate sluggify url from given string if there are spaces or special character in string that is not good for user friendly URL then it remove all these spaces and special character from string.
Example 1:
$exampleSlug = Str::slug('Example of str slug');
dd($exampleSlug);
Example 2: but you want to use helpers functions then you need to install new composer package with command as bellow:
composer require laravel/helpers
Now you can use helper function as bellow:
$exampleSlug = str_slug('Example of str Slug');
dd($exampleSlug);
it will help you....
- How to Notifications With database Driver in Laravel 11?
- How to Send Email Via Notification in Laravel 11?
- How to Install and Configure Laravel 11 Debugbar?
- How to Like Dislike System in Laravel 11?
- How to Paginate a Model with Relationship in Laravel 11?
- Laravel 11 Upload Files to Amazon S3 Example
- Laravel 11 Send WhatsApp Messages Example
- Laravel 11 Rest API Authentication Using JWT Tutorial