Reputation: 167
I have a code.. but laravel previous version it was not given any error. now how can I solve it thank you
public function storecategory(Request $request){
$request->validate([
'name'=>'required',
]);
$category=new Category();
$category->name=$request->name;
$category->slug=str_slug($category->name);
$category->save();
}
This code is given Call to undefined function App\Http\Controllers\str_slug()
Upvotes: 0
Views: 137
Reputation: 1452
Helpers have been moved to a separate package. You have to install it.
composer require laravel/helpers
Upvotes: 2