Why the Laravel helpers are deprecated in version 5.8?

Viewed 301

I am a happy Laravel user and I love the Laravel helpers. They are very easy to use:

{{ str_limit($text) }}

But really really don't understand why this is they way:

{{\Illuminate\Support\Str::limit($text)}}

Why...?

2 Answers

From the pull request:

They pollute the global namespace and they don't bring any additional value to the framework. They don't even save you the amount of characters that you have to type as in a bunch (or maybe in all?) of cases it's actually shorter to use the Arr and Str methods directly.

https://github.com/laravel/framework/pull/26898

If you still want to use them you can install the laravel/helpers package

Related