bardolf_6969
Adding a progress bar to a filament form.
I have a form that performs an import of data that can run for a long time in some circumstances. I've got the backend sorted so it doesn't timeout but occasionally I get a timeout from Cloudflare. To solves this I thought I could add a progress bar that updates as the records are being processed but I can't figure out how to make this work. I started with a custom field that is has a html progress bar in it and linked that to a progress variable in the backend. But I can't seem to get it to update as the records are being processed.
4 replies
Custom property with Medialibrary
I'm trying to work out how to store a custom property with uploaded images to say whether it is landscape, portrait, or square. I was planning on dividing the width by the height and if the result < 0.75 = landscape, result > 1.25 = portrait, otherwise square. But how can I make those calculation on the uploaded image before it is stored in the database?
3 replies
How to change resource form opened by edit action on a relationmanager
This is going to get confusing but let me try. I have 2 models Degree and Programs, these share a many to many relationship that includes pivot table data. These tables are also accessed from a different (legacy) application so the pivot table needed to have it's own id field. So I made a model and resource in filament called DegreeProgram. I have setup the forms etc for DegreeProgram in filament but it looks ugly having it on the navigation menu.
Within the DegreeResource I have a relationmanager for programs and would like to have the create and edit actions from that relation manager redirected to the create and edit forms for the DegreeProgramResource instead, while leaving the attach/deteach actions link the the original relationship.
I tried editing the relationship manager to use the other form but that threw this error
So then I tried mutating the data being sent to the form like this
but that throws this error
Does anyone have any other ideas?
3 replies
is it possible to open a relationship in a modal?
I have a model (property) that is the child in three one to many relationships. I want users to be able to edit the parent record for each of those relationships without having to navigate away from the property. The relationship is currently being set via a select.
Originally I created a hidden subform that was displayed when the select had a value but other than refreshing the entire page I couldn't workout how to populate the data in that subform. Then I tried using a action form via the header actions in the section containing the select and that sort of works but because it is being loaded from what is available in the $record I can't see how to get all of the relation stuff (images, tags, etc.) into the modal.
Originally I created a hidden subform that was displayed when the select had a value but other than refreshing the entire page I couldn't workout how to populate the data in that subform. Then I tried using a action form via the header actions in the section containing the select and that sort of works but because it is being loaded from what is available in the $record I can't see how to get all of the relation stuff (images, tags, etc.) into the modal.
27 replies
Reload a subform after select value changes
I have a select that is setting a many-to-many relationship between my room and building records. As there are many buildings with very similar names I want to show a details panel below the select with the main details of the selected building.
I have the select working and the details panel is shown after a selection is made but the vlaues are all empty.
I'm guessing I need to repopulate those fields after the select value is changed but I don't know how to achieve this. Any suggestions on this would be hugely appreciated. I'm trying to paste the code snippet for the select and details section but discord wants to make it an attachment for some reason.
I have the select working and the details panel is shown after a selection is made but the vlaues are all empty.
I'm guessing I need to repopulate those fields after the select value is changed but I don't know how to achieve this. Any suggestions on this would be hugely appreciated. I'm trying to paste the code snippet for the select and details section but discord wants to make it an attachment for some reason.
2 replies
Unable to upload multiple images at the same time
When I try to upload more than one image to my SpatieMediaLibraryFileUpload component it returns a 422 error with the following response If I then save it will have saved the first image I uploaded.
If I upload multiple images, one at a time and save the resources between each upload they work fine.
I'm using filament/spatie-laravel-media-library-plugin v3.2.92
If I upload multiple images, one at a time and save the resources between each upload they work fine.
I'm using filament/spatie-laravel-media-library-plugin v3.2.92
6 replies
If a relationship is hidden on a resource form does filament still try to submit it?
I have a resource form that when no relationship is set displays a select box but that changes to a section displaying the details once the relationship is set. The problem is when submitting the form I'm getting an error that a null value in the relation violates not-null constraint. Below is the section of the form
4 replies
Custom page with a wizard form
Ok only started using Filament this week, so forgive me if I'm missing something very basic. I'm trying to create a custom page with a wizard form component. I've got that working but when I try to add a select to the first page of the wizard based on a relationship in the model I get an error message
7 replies
Customizing the Registration Page
Rather than a single name field I need my User model to have 3 seperate name fields (first_name, middle_names, last_name). I've followed the example, in the docs, of extending filaments builtin registration class and overriding the form method. This works fine and changes the form but when I try to use it I get an error that the route doesn't accept POST requests. I then tried overriding the getForms method instead of the form method thinking that maybe skipping straight to the form something was being missed but the result was the same. Can anyone tell me what I'm doing wrong?
3 replies
Use value from first select filter to limit results in second select filter
I've got the standard city, state, country setup and can access all the relevant details in the table itself.
What I'm hoping to do is in the city table I have 2 select filters. 1 for country and one for state. I'd like it so that once they select a country it reduces the options in the state select to only have states from that country. I know I can customize the relationship callback for the select filter but how can I access the value selected in the first select?
What I'm hoping to do is in the city table I have 2 select filters. 1 for country and one for state. I'd like it so that once they select a country it reduces the options in the state select to only have states from that country. I know I can customize the relationship callback for the select filter but how can I access the value selected in the first select?
6 replies