“Call to undefined function str_slug()” in Laravel 6.0

前端 未结 3 2052
梦毁少年i
梦毁少年i 2021-02-04 23:22

I\'ve upgraded my laravel 5.8 project to 6.0. It has upgraded successfully but when I\'m trying to run the project or installing another package to my project it is giving me er

3条回答
  •  后悔当初
    2021-02-04 23:57

    String and Array helpers are removed from laravel 6.0 Core Framework

    https://laravel.com/docs/6.0/upgrade#helpers

    So if You need to still use the helper install the package

    composer require laravel/helpers
    

    Or you can use by Laravel facade

    use Illuminate\Support\Str;
    $slug = Str::slug('Laravel 5 Framework', '-');
    

提交回复
热议问题