Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

Commit

Permalink
Redirect to proper locale after saving a Translatable entity.
Browse files Browse the repository at this point in the history
  • Loading branch information
ageshev authored May 22, 2018
1 parent 1d3d18b commit dd027d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Http/Controllers/EntityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ public function store(AdminFormRequest $request)
$redirectRoute = route($this->getResourceConfig()['id'] . '.create');
}

return redirect($redirectRoute . (array_get($input, 'parent_model') ? array_get($input, 'parent_model') : ''));
if ($this->model instanceof Translatable) {
$redirectRoute .= '?locale=' . $input['locale'];
}

return redirect($redirectRoute);
}

/**
Expand Down

0 comments on commit dd027d5

Please sign in to comment.