area17 / twill

Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/cnWk7EFv8R.
https://twillcms.com
Apache License 2.0
3.8k stars 577 forks source link

CLI commands to remove modules/blocks/... #2383

Closed maicol07 closed 9 months ago

maicol07 commented 11 months ago

Summary

Currently, we can generate modules, blocks, capsules, ... via php artisan twill:make:<type> but we can't delete them via CLI.

Describe the solution you'd like

A mirror command to delete the generated files and DB tables. Example:

> php artisan twill:destroy:block my_block
Are you sure you want to remove my_block? yes
Block removed successfully.
> 
ifox commented 9 months ago

Hi @maicol07 this is definitely a cool idea, but it feels a bit overkill. For a module, it could easily delete classes, but identifying the migration file to delete feels like a hack. if you're using capsules, deleting a module is about dropping a single folder, so the command would feel unnecessary. Same for blocks, they are a single file.

I wouldn't discard a clean PR that does it, but it's not something I think we should spend time on on our end.

Something we've been feeling like we could need, would be a rename module/capsule command. But even that, we haven't felt like we really needed it that much to invest time into.