From: Vincent Vanwaelscappel Date: Fri, 12 Jul 2019 15:20:02 +0000 (+0200) Subject: #2757 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6ffa95a82c1a32cb6645ec1e413ebf72ebd0ac24;p=cubist_cms-back.git #2757 --- 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; } /**