dwijitsolutions / laraadmin

LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like Advanced CRUD Generation, Module Manager, Backups and many more.
http://laraadmin.com
MIT License
1.58k stars 537 forks source link

Creating relationships code in Model - Models Overwrite Issue #243

Open mwamp opened 7 years ago

mwamp commented 7 years ago

First thanks for the excellent project, It's shame it seems stalled, it shows great promise and many things can get better.

One of the issues is that updating CRUDS overwrite every file automatically generated. For controllers and migration, I don't mind so much, it's easy to create new files and add logic. For models it's a bit of a shame. It would be understandable if code was produced for relationships in the model (which would be a great feature btw and not out of reach). In that case I would recommend creating a model : foo_crud which has the laraadmin code in it and will be overwritten during updates and a model foo descending from foo_crud where we can add new logic without fear of overwrites.

For now I just added if(!model_file_exists) in CodeGenerator.php ->createModel.

Cheers

gdbhosale commented 7 years ago

Creating relationships by default can be a good idea, but very complicated. Will look into it. Thanks 👍 We always recommended using git to avoid problems due to overwrites. Best Editor for this work would be Visual Studio Code. We cannot do anything about it. You need to redo your customisations.

leopinzon commented 6 years ago

+1 to this enhancement. Awesome project but needs to be more flexible for customizations done after creating a CRUD