mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
settings added
This commit is contained in:
@@ -23,20 +23,26 @@ class Header extends Component
|
||||
|
||||
public string $l = 'de';
|
||||
|
||||
public string $timezone;
|
||||
|
||||
public $bgColor = 'bg-21gray';
|
||||
|
||||
protected $queryString = ['l'];
|
||||
|
||||
protected $listeners = ['refresh' => '$refresh'];
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'c' => 'required',
|
||||
'l' => 'required',
|
||||
'c' => 'required',
|
||||
'l' => 'required',
|
||||
'timezone' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->timezone = config('app.user-timezone');
|
||||
$this->l = Cookie::get('lang') ?: config('app.locale');
|
||||
if (!$this->country) {
|
||||
$this->country = Country::query()
|
||||
@@ -47,6 +53,15 @@ class Header extends Component
|
||||
$this->c = $this->country->code;
|
||||
}
|
||||
|
||||
public function updatedTimezone($value)
|
||||
{
|
||||
auth()
|
||||
->user()
|
||||
->update(['timezone' => $value]);
|
||||
|
||||
return redirect(request()->header('Referer'));
|
||||
}
|
||||
|
||||
public function updatedC($value)
|
||||
{
|
||||
return to_route($this->currentRouteName, ['country' => $value, 'lang' => $this->l]);
|
||||
|
||||
Reference in New Issue
Block a user