Laravel Call to undefined function str_slug() – Solved

composer require laravel/helpers

Route::get(‘/’, function () {
$newSlug = str_slug(‘I am from ItSolutionStuff.com’);

dd($newSlug);
});

You can use Helpers like this way:

Arr::add
Arr::collapse
Arr::divide
Arr::dot
Arr::except
Arr::first
Arr::flatten
Arr::forget
Arr::get
Arr::has
Arr::last
Arr::only
Arr::pluck
Arr::prepend
Arr::pull
Arr::random
Arr::set
Arr::sort
Arr::sortRecursive
Arr::where
Arr::wrap

Str::after
Str::before
Str::camel
Str::contains
Str::containsAll
Str::endsWith
Str::finish
Str::is
Str::kebab
Str::limit
Str::orderedUuid
Str::plural
Str::random
Str::replaceArray
Str::replaceFirst
Str::replaceLast
Str::singular
Str::slug
Str::snake
Str::start
Str::startsWith
Str::studly
Str::title
Str::uuid
Str::words