_max28
_max28
FFilament
Created by _max28 on 9/2/2023 in #❓┊help
How can I take the user-selected value in one form field for use in another field?
I would like to make the default() method dynamic by inserting a specific value based on the user's choice in the fk_servizio field, below is the code
Select::make('fk_servizio')
->label('ID Servizio')
->options(Servizi::all()->pluck('id', 'id'))
->searchable()
->required(),

TextInput::make('commissione')
->label('Importo')
->numeric()
->minValue(Servizi::where('id', ???)->value('amount'))
->default(Servizi::where('id', ???)->value('amount'))
->required(),
Select::make('fk_servizio')
->label('ID Servizio')
->options(Servizi::all()->pluck('id', 'id'))
->searchable()
->required(),

TextInput::make('commissione')
->label('Importo')
->numeric()
->minValue(Servizi::where('id', ???)->value('amount'))
->default(Servizi::where('id', ???)->value('amount'))
->required(),
10 replies
FFilament
Created by _max28 on 8/31/2023 in #❓┊help
Accessing form values after saving
i need to monitor the change of a field in the form inside the afterSave() method, i know i can access the values ​​via $this->record. But I don't know how I can access the original values ​​and the modified ones. How could I do?
8 replies
FFilament
Created by _max28 on 8/30/2023 in #❓┊help
Customizing the creation process
Hi guys, could you tell me how I can insert the mandatory return without creating the record since the ApplyCashback Job that applies custom dynamics already does it?
protected function handleRecordCreation(array $data): Model
{
ApplyCashback::dispatch($data['userId'], $data['serviceId']); // Job with creating logic
return static::getModel()::create($data); // I don't need to create another record
}
protected function handleRecordCreation(array $data): Model
{
ApplyCashback::dispatch($data['userId'], $data['serviceId']); // Job with creating logic
return static::getModel()::create($data); // I don't need to create another record
}
9 replies
FFilament
Created by _max28 on 7/30/2023 in #❓┊help
Page creation with 2 tables inside
I want to create a page with 2 tables inside that take the data respectively from the Transactions and Historic_Cashback models. How could I do? I have already created a page but I don't know how to insert the two tables. Thanks in advance
3 replies