Edit Code and Merge Changes
Last updated
Last updated
"Can I edit the code after download and generate more CRUDs? How can I merge changes?"
Pretty common questions we get asked by customers. Imagine you've built a panel, downloaded it and then decided to change some code locally. After a while, you need to build another new CRUD on top – how do you merge changes?
It’s tricky. We didn't build QuickAdminPanel for that scenario, our vision always was that we help to developer a "boilerplate" to download and then proceed manually, without getting back for more CRUDs/modules.
Also, QuickAdminPanel can't accept/import your code changes into generator, cause we can't guarantee the outside code is valid, correct and doesn't contain any security issues.
So what should you do? Two ways we can help.
You have a “magic button” called Push to GitHub.
What it does is pushes a new branch to your GitHub with the latest version of your panel code. System doesn’t know what changes you made in your repository or locally, it just pushes the latest version. From there you still need to merge the changes manually, but it’s much much easier with git merge tools than just doing manually.
It’s similar how Laravel Shift works when upgrading your Laravel version – it puts a new branch with suggested code after upgrade, with a lot of comments, and then you decide on what actually gets merged.
We have prepared a guide on what files are created inside of every CRUD. So, after using the generator to create a new CRUD, you could identify what exactly are the files to copy-paste, or what file contents to extract.
Read here and watch video: What Files are Inside the CRUD
Even having those two ways to help you in merging, is still not that comfortable, you still need to do manual work comparing changes and picking the right ones.
We didn’t come up with a better way so far, cause our system doesn’t know what local changes you made and we can’t accept your code for merging online cause then our generator would break with your custom code. But if you have any ideas how we can make it better, please email me personally povilas@laraveldaily.com – more than happy to discuss.
What we do internally, when using QuickAdminPanel for client projects, we generate as much as possible with the generator (yes, it requires a lot of thinking upfront with DB schema and pen/paper), and then after download we don’t touch generator at all – all other changes are done locally in PHPStorm.
It not only allows to avoid such code conflicts, but also forces to think upfront, which is really beneficial for the project overall.