With laravel 6 theme and asset management package Facuz\Theme package
return an errot Call to undefined function Facuz\Theme\array_get()
return is_null($key) ? $this->themeConfig : array_get($this->themeConfig, $key);
This appears to be a breaking change in Laravel 6.0
5.6 - Uses the following
array = ['products' => ['desk' => ['price' => 100]]];
$price = array_get($array, 'products.desk.price');
6.0 - Uses the following
$array = ['products' => ['desk' => ['price' => 100]]];
$price = Arr::get($array, 'products.desk.price');
https://laravel.com/docs/6.0/helpers#method-array-get
https://laravel.com/docs/5.6/helpers#method-array-get
It looks like this call is only used in 3 places in the codebase:
https://github.com/FaCuZ/laravel-theme/search?q=array_get&unscoped_q=array_get
Answer: Try update the calls in the package to match 6.0 ( Assuming there is no other breaking changes) this should work. If it works im sure a lot of people would be thankful for the pull request.
Laravel 6.x and 7.x uses Arr::get()
equivalent to array_get()
.To use it add the array facade on the top of your controller or php file
use Illuminate\Support\Arr;
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$price = Arr::get($array, 'products.desk.price');
For more info on laravel 6.x arrays and helpers
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