From aca21453ff22334ed1ca4bc0509f97fae2935a45 Mon Sep 17 00:00:00 2001 From: tabuna Date: Fri, 14 Jul 2017 05:49:20 +0300 Subject: [PATCH] fix show post edit --- src/Http/Controllers/Posts/PostController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Http/Controllers/Posts/PostController.php b/src/Http/Controllers/Posts/PostController.php index 0949e0997e..cb0724598c 100644 --- a/src/Http/Controllers/Posts/PostController.php +++ b/src/Http/Controllers/Posts/PostController.php @@ -128,11 +128,13 @@ public function store(Request $request, PostBehavior $type, Post $post): Redirec public function edit(PostBehavior $type, Post $post): View { $this->checkPermission('dashboard.posts.' . $type->slug); - $locales = $this->locales->map(function ($value, $key) use ($post) { - $value['required'] = (bool)$post->checkLanguage($key); + $locales = $this->locales->map(function ($item) { + if ($item['required'] == true) { + return true; + } - return $value; - })->where('required', true); + return false; + }); return view('dashboard::container.posts.edit', [ 'type' => $type,