From c62ea8d9b575b3bd7ffc68d48703949ef6a24931 Mon Sep 17 00:00:00 2001 From: Alex Agafonov Date: Thu, 19 Dec 2019 01:35:10 +0300 Subject: [PATCH] Update Rating.php In Laravel 6.5 array_get function not exist --- src/Rating.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Rating.php b/src/Rating.php index a5cdd11..b60afb8 100644 --- a/src/Rating.php +++ b/src/Rating.php @@ -115,7 +115,13 @@ public function withStyles(array $styles) { $build = []; foreach (static::$defaultStyles as $key => $defaultValue) { - $build[$key] = Arr::get($styles, $key, $defaultValue); + // In Laravel 6.5 array_get function not exist + if (function_exists('array_get')) { + $build[$key] = array_get($styles, $key, $defaultValue); + } else { + $build[$key] = Arr::get($styles, $key, $defaultValue); + } + } return $this->withMeta($build);