mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
This commit is contained in:
parent
0322ec899e
commit
b10bbca774
9 changed files with 168 additions and 12 deletions
|
|
@ -11,9 +11,12 @@ use Livewire\Volt\Component;
|
|||
new class extends Component {
|
||||
public ?int $assign_new_device_id = null;
|
||||
|
||||
public ?string $timezone = null;
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->assign_new_device_id = Auth::user()->assign_new_device_id;
|
||||
$this->timezone = Auth::user()->timezone ?? config('app.timezone');
|
||||
}
|
||||
|
||||
public function updatePreferences(): void
|
||||
|
|
@ -26,6 +29,11 @@ new class extends Component {
|
|||
->whereNull('mirror_device_id');
|
||||
}),
|
||||
],
|
||||
'timezone' => [
|
||||
'nullable',
|
||||
'string',
|
||||
Rule::in(timezone_identifiers_list()),
|
||||
],
|
||||
]);
|
||||
|
||||
Auth::user()->update($validated);
|
||||
|
|
@ -39,6 +47,14 @@ new class extends Component {
|
|||
|
||||
<x-settings.layout heading="Preferences" subheading="Update your preferences">
|
||||
<form wire:submit="updatePreferences" class="my-6 w-full space-y-6">
|
||||
|
||||
<flux:select wire:model="timezone" label="Timezone">
|
||||
<flux:select.option value="" disabled>Select timezone...</flux:select.option>
|
||||
@foreach(timezone_identifiers_list() as $tz)
|
||||
<flux:select.option value="{{ $tz }}">{{ $tz }}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
|
||||
<flux:select wire:model="assign_new_device_id" label="Auto-Joined Devices should mirror">
|
||||
<flux:select.option value="">None</flux:select.option>
|
||||
@foreach(auth()->user()->devices->where('mirror_device_id', null) as $device)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue