DarkCoder
Use value from parent model as default in attachAction relationmanager
I have a Service Model and a Doctor Model, and a ServiceDoctor Pivot Table.
I am using a relation manager to attach Doctors to Services. The Pivot Table also has some extra fields like price and time. The service table also have fields named default_price and default_time
I want to attach action to set the default values during attachment. Is this possible?
4 replies
Throwing ValidationException from afterStateUpdated
Hi, is it possible to throw a ValidationException from the afterStateUpdated lifehook on a form field?
Is there any other way to do it using halts?
But this doesnt seem to work. I can send Notifications but I want the validation error to trigger
3 replies
Equivalent of UpdateOrCreate
Hello, I want the createAction to check if a record already exists and then update it instead of creating a new entry everytime. I've thought about using handleRecordCreation() but it creates a new record anyway.
4 replies
Auto Creating Child Model from Parent Resource
Hello, I have two Resources/modes, Appointment and Client
Every appointment has a BelongsTo relation called client()
Clients have hasMany appointments.
I created the resources with --generate, and on the appointments create page, I can only put in the details of the appointment and choose an existing client from a select box.
However, I want to create the client while Im creating the appointment. In other words, I want the fields of client creation to be shown in the appointment creation page, and on submit filament should first create the client, and then automatically handle the relationship.
I have tried relationshipmanager and it only works for editing and viewing but not creating.
I have tried to add the client fields manually
but it gives an error that client_id is required
Is this possible?
1 replies