Categories: Laravel Framework - The PHP Framework For Web Artisans, Laravel News | Laravel 5.7 - Techanical-Atom

Laravel 5.8 Deprecate Arr and Str Global Helper Methods1 min read

Laravel 5.8 Deprecates String and Array Helpers
Reading Time: 1 minute

In the upcoming version of Laravel that is Laravel 5.8 , it Deprecates Arr and Str global helper methods. And from Laravel 5.9 they will be removed completely. Now if you want ot use them in the Laravel 5.8 then you have to use the classes\Illuminate\Support\StrIlluminate\Support\Arr directly instead of using the helpers.

The reason for deprecating them in Laravel 5.8 being that they add a lot of fucntions to the global namespace and in addition to that they migth conflict withe packages as well. Taylor Otwell has said in the PR ,

I think deprecating them is a good idea because right now we force them on developers and they do add a lot of functions to the global namespace that can conflict with other packages, etc.
That being said, I think we should package them up in a laravel/helpers Composer package that people can pull into their projects if they want to quickly get them back in.

What we can conclude from the above statement is that there will be a helper function in laravel/helpers , that will allow the people to use them in their projects.

Read More:- Laravel Tutorials For Beginners Step By Step Guide – Part 1

But it is still very early to predict as these are ongoing changes and we don’t know what future will hold.It is at the end of the day Taylor Otwell who has the last say here. You can see the upcoming Laravel 5.8 upgrade documentation on preferring String and Array classes over helpers

All Rights Reserved @ Techanical-Atom
%d bloggers like this: