Laravel 8 Call to undefined function str_slug()

 Install laravel/helpers package

1
composer require laravel/helpers

Use the below code in your own controller

1
2
use Illuminate\Support\Str;
$posts->slug = str_slug($request->input('title').' '.$posts->id, '-');

Comments

Popular posts from this blog

Js adding Modify and Deleting Properties

JS Rest Parameter

How to Add Social Media Share Buttons in Laravel?