switch header country and lang

This commit is contained in:
HolgerHatGarKeineNode
2023-02-28 00:17:16 +01:00
parent 11591806a7
commit 9b67cadb0d
3 changed files with 78 additions and 4 deletions

View File

@@ -64,14 +64,17 @@ class Header extends Component
public function updatedC($value)
{
return to_route($this->currentRouteName, ['country' => $value, 'lang' => $this->l]);
$url = str(request()->header('Referer'))->explode('/');
$url[3] = $value;
return redirect($url->implode('/'));
}
public function updatedL($value)
{
Cookie::queue('lang', $this->l, 60 * 24 * 365);
return to_route($this->currentRouteName, ['country' => $this->c, 'l' => $value]);
return redirect(request()->header('Referer'));
}
public function render()