Skip to content

Commit

Permalink
fix show post edit
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna committed Jul 14, 2017
1 parent 6512551 commit aca2145
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Http/Controllers/Posts/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit aca2145

Please sign in to comment.