From 6ffa95a82c1a32cb6645ec1e413ebf72ebd0ac24 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 12 Jul 2019 17:20:02 +0200 Subject: [PATCH] #2757 --- src/app/Magic/PageData.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/Magic/PageData.php b/src/app/Magic/PageData.php index 30eee29..fa3d927 100644 --- a/src/app/Magic/PageData.php +++ b/src/app/Magic/PageData.php @@ -7,6 +7,7 @@ namespace Cubist\Backpack\app\Magic; use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel; use Cubist\Backpack\app\Magic\Models\CubistMagicModel; use Illuminate\Support\Arr; +use Illuminate\Support\Facades\App; use Spatie\MediaLibrary\Models\Media; class PageData implements \ArrayAccess @@ -82,7 +83,15 @@ class PageData implements \ArrayAccess */ public function get($offset, $default = null) { - return Arr::get($this->_data, $offset, $default); + $res = Arr::get($this->_data, $offset, $default); + if ($offset == 'form') { + dd($res); + } + if (is_array($res) && isset($res[App::getLocale()])) { + $res = $res[App::getLocale()]; + } + + return $res; } /** -- 2.39.5