Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.

Filament plugin doesn't change crud #420

Open
num3r06 opened this issue Apr 28, 2023 · 14 comments
Open

Filament plugin doesn't change crud #420

num3r06 opened this issue Apr 28, 2023 · 14 comments

Comments

@num3r06
Copy link

num3r06 commented Apr 28, 2023

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:

  1. In the new project add a crud app and install filament plugin
  2. Generate and run
  3. modifiy crud app adding a relation in substitution of a field
  4. regenerate all
  5. 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
@TiagoSilvaPereira
Copy link
Owner

@num3r06 thank you for reporting. I'm adding @nicollassilva to this conversation to check what is happening

@nicollassilva
Copy link
Collaborator

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.

@num3r06
Copy link
Author

num3r06 commented May 4, 2023

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

@TiagoSilvaPereira
Copy link
Owner

@nicollassilva

@num3r06
Copy link
Author

num3r06 commented May 4, 2023

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

@TiagoSilvaPereira
Copy link
Owner

@num3r06 did you filled the options to generate the relationships in the Plugin page?

image

@flashmediasolutions
Copy link

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.

@TiagoSilvaPereira
Copy link
Owner

@flashmediasolutions could you please record a video showing the issue ?

@flashmediasolutions
Copy link

flashmediasolutions commented May 16, 2023

The system seems to update everything (that I have checked) except the Resource.php file. So anything after the initial creation doesn't update.

FilamentIssue.mov

@TiagoSilvaPereira
Copy link
Owner

@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

@flashmediasolutions
Copy link

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.

@TiagoSilvaPereira
Copy link
Owner

@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)

@flashmediasolutions
Copy link

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

@TiagoSilvaPereira
Copy link
Owner

@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:

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants