public function mount()
{
$this->customer = User::find(1);
$this->form->fill([
'notifications' => $this->customer->userNotifications
]);
}
public function getFormSchema(): array
{
return [
Repeater::make('notifications')
->schema([
TextInput::make('notification')
->hiddenLabel()
->columnSpan(2)
->disabled(),
Toggle::make('email')->label('E-mail'),
Toggle::make('sms')->label('Text')
])->addable(false)->columns(4)->reorderable(false)->deletable(false)->hiddenLabel()
];
}
public function getFormModel(): Model|string|null
{
return $this->customer;
}
public function save()
{
$this->form->model($this->customer)->saveRelationships();
}
public function mount()
{
$this->customer = User::find(1);
$this->form->fill([
'notifications' => $this->customer->userNotifications
]);
}
public function getFormSchema(): array
{
return [
Repeater::make('notifications')
->schema([
TextInput::make('notification')
->hiddenLabel()
->columnSpan(2)
->disabled(),
Toggle::make('email')->label('E-mail'),
Toggle::make('sms')->label('Text')
])->addable(false)->columns(4)->reorderable(false)->deletable(false)->hiddenLabel()
];
}
public function getFormModel(): Model|string|null
{
return $this->customer;
}
public function save()
{
$this->form->model($this->customer)->saveRelationships();
}