vemto-issues
vemto-issues copied to clipboard
Filament plugin doesn't change crud
Describe the bug Hi, i use filament plugin and at the first start all work fine. But i try to modify a crud adding a relationship field. In the crud app all works in filament dashboard the new field not appears. I try to duplicate project, delete and regenerate folder, uninstall e reinstall plugin, deselect and reselect the crud in the plugin panel but seems to be cached an older version
To Reproduce Steps to reproduce the behavior:
- In the new project add a crud app and install filament plugin
- Generate and run
- modifiy crud app adding a relation in substitution of a field
- regenerate all
- the changes not appear
Expected behavior The changes in crud app must been reflected in filament admin panel Desktop (please complete the following information):
- win11 with laragon
- Chrome
- Last version
@num3r06 thank you for reporting. I'm adding @nicollassilva to this conversation to check what is happening
Hi @num3r06 , I hope you are well.
I followed your steps but I couldn't reproduce locally. My steps were as follows:
I created a Post model, and a field called post_category_id. Soon after, I created the CRUDs, installed the Filament and generated the files.
After that, I created a model called PostCategory and created a relationship with posts, replacing the post_category_id field to make a relationship field. I went back to the Post CRUD, added a select for the post_category_id relationship, and to the Filament plugin configuration, I filled it in to generate the relationship.
It worked normally, can you tell me if the steps are right? And if you want, leave your .vemto with a more detailed explanation of the problem.
Thanks.
Hi, The correct workflow is:
- Create a post model with category field
- Generate and run project
- Adding a category model
- adding a relationship between two models Deleting category field in post model and add post_category_id
- Regenerate and rerun project
@nicollassilva
In a new test I realized that even in the regeneration of the project the models are not updated with the correct relationships outside filament
@num3r06 did you filled the options to generate the relationships in the Plugin page?
Noticing same issues. The resources are not updating after changing / adding fields in Vemto using the Filament plugin. It's almost as though the initial generation output is cached and not updating on future generation.
@flashmediasolutions could you please record a video showing the issue ?
The system seems to update everything (that I have checked) except the Resource.php file. So anything after the initial creation doesn't update.
https://github.com/TiagoSilvaPereira/vemto-issues/assets/12239388/c34aaac6-eac7-4901-a78e-bd7c65c520bd
@flashmediasolutions The Filament plugin is based on CRUD applications, not in the model. You need to add the input to the CRUD after creating a new column
I assumed that if I added a column to Vemto that it would update all the corresponding files, like it does with the Nova plugin. Without that dynamic file update, it makes the Filament / Vemto plugin useless after initial generation.
@flashmediasolutions I'm not sure why you think it is useless. As I said, If you add the input to the CRUD after adding the column, the plugin will generate it without problems (you can always edit CRUD after first generating them). It just takes another step: add the column, then add the CRUD input (it is because the Filament plugins use the CRUD settings to guess what type of input it needs to generate).
Anyway, for Vemto 2, I'll take another approach for the Filament plugin (not attached to CRUD applications)
It looks like if I delete the CRUD and re-add it back any new fields now generate correctly.
So I believe there is still a bug, but deleting and re-adding the CRUD is a work around.
Thanks
@flashmediasolutions It is not necessary to delete a CRUD and generate it again. You can open the CRUD editor and add an input for the new Model column: