I've upgraded to Laravel 5.8
One of the changes as per the docs in 5.8 is that All array_* and str_* global helpers have been deprecated (https://laravel.com/docs/5.8/upgrade#string-and-array-helpers)
In my blade view I have the following:
{{ (Arr::has($queryString, 'industry') ? Arr::get($queryString, 'industry') : '') }}
This is throwing error:
Class 'Arr' not found...
If I include the full name space then it works:
{{ (Illuminate\Support\Arr::has($queryString, 'industry') ? Illuminate\Support\Arr::get($queryString, 'industry') : '') }}
Please advise.
I figured it out.
Need to update the app config file and include the following to the aliases array:
'Arr' => Illuminate\Support\Arr::class,
'Str' => Illuminate\Support\Str::class,
Then clear the config cache in order for the new aliases to start working:
php artisan cache:clear
[editor's note: an earlier typo has now been corrected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With