laravel / nova-issues

554 stars 34 forks source link

Create fields from database #328

Closed mariapaulinar closed 6 years ago

mariapaulinar commented 6 years ago

We need to automate the creation of fields from fields in an existing database, is there any way to do it in Nova? Maybe some package or tutorial on how to achieve this? Thank you.

bradenkeith commented 6 years ago

@mariapaulinar a good start would be the documentation https://nova.laravel.com/docs/1.0/

Nova is meant to sit on top of existing applications and interact with existing databases. Can you provide more information on what in particular you are hoping to accomplish?

poxin13 commented 6 years ago

I saw this the other day, might be closer to what you're looking for: https://medium.com/@InaniT0/generate-your-resource-fields-with-no-pain-108d7369489e

mariapaulinar commented 6 years ago

@bradenkeith thanks for responding soon. I really understand that it is made to work with existing databases, however we have cases of tables with many fields, I wanted to know if with Nova we have at hand tools to generate fields in the resources taking the fields that exist in the tables and that define the type of field to use using the type of data that the field contains in the table. An approximate example could be like the scaffolding process that the InfyOm package has (http://labs.infyom.com/laravelgenerator/). I hope this time to have explained myself better :)

@poxin13 thanks, I'll take a look ;)

telkins commented 6 years ago

This might be a nice feature to add. Something that queries the model/table to generate default nova fields. Then, the developer just has to tweak any exceptions.

Whether this is on the fly, a part of artisan's nova:resource implementation, or even something else...I don't know. But, it could be a nice way to minimize the scaffolding.

I think Laravel Backpack has something like this that "builds" the fields from the related model/table.

davidhemphill commented 6 years ago

We have no plans to add this at this time.

mariapaulinar commented 6 years ago

This feature has been satisfied with the following package: https://krato.github.io/resource-generator-docs/1.0/