In cache.php line 91: Call to undefined function str_slug()

Posted by

Problem :-

When i run Composer Install in my Laravel project to upgrade my project’s version in Laravel 10 after adding all the dependencies i got this Error:

PS C:\xampp-laravel\htdocs\ds-admin-ms> composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Class App\Http\Controllers\PassportAPI\QuoteManagementController located in C:/xampp-laravel/htdocs/ds-admin-ms/app\Http\Controllers\PassportApi\QuoteManagementController.php does not comply with psr-4 autoloading standard. Skipping.
Class App\Http\Controllers\CoursesSendMailController located in C:/xampp-laravel/htdocs/ds-admin-ms/app\Http\Controllers\StudentCourseSentMailController.php does not comply with psr-4 autoloading standard. Skipping.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In cache.php line 91:

  Call to undefined function str_slug()  


Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

Code :-

Solution:- In this error there is error in the following code which you can see on the above image.

To solve this error you need to run one command so that it can take all the dependencies in your Laravel 10 Project. Bellow is the command :

composer require laravel/helpers

This will solve that error in the code. As you can see in the below image the red mark is removed.

now you can run the Composer install command in this project to upgrade laravel version.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x