ots
ots
FFilament
Created by ots on 1/3/2024 in #❓┊help
custom page repeater does not delete from database
public function editShippingForm(Form $form): Form
{
return $form->schema([
Repeater::make(__('labels.shipping_methods'))
->schema([
TextInput::make('erp_code')
->required()
->label(__('labels.erp_or_store')),
TextInput::make('store_code')
->label(__('labels.store_code'))
->required(),
])
->columns(2)
->addActionLabel(__('labels.new_entry'))
->statePath('shippingData')
]);
}
public function editShippingForm(Form $form): Form
{
return $form->schema([
Repeater::make(__('labels.shipping_methods'))
->schema([
TextInput::make('erp_code')
->required()
->label(__('labels.erp_or_store')),
TextInput::make('store_code')
->label(__('labels.store_code'))
->required(),
])
->columns(2)
->addActionLabel(__('labels.new_entry'))
->statePath('shippingData')
]);
}
in this form when removing a repeated text input it does update the state but does not actually remove it from the database. is there a way to link the model in this custom page? or a way to override the default delete function? This is how my data is mounted
$shippingData = SettingsShipping::all();


$formattedShippingData = [];

foreach ($shippingData as $shippingDatum) {
$formattedShippingData[] = [
'erp_code' => $shippingDatum->erp_code,
'store_code' => $shippingDatum->store_code,
];
}

$this->editShippingForm->fill(['shippingData' => $formattedShippingData]);
$shippingData = SettingsShipping::all();


$formattedShippingData = [];

foreach ($shippingData as $shippingDatum) {
$formattedShippingData[] = [
'erp_code' => $shippingDatum->erp_code,
'store_code' => $shippingDatum->store_code,
];
}

$this->editShippingForm->fill(['shippingData' => $formattedShippingData]);
3 replies
FFilament
Created by ots on 12/13/2023 in #❓┊help
https://filamentphp.com/plugins/bezhansalleh-language-switch
did the installation and usage part does not render anything to navbar
3 replies