Generators icon indicating copy to clipboard operation
Generators copied to clipboard

Add --force argument to php artisan backpack:crud

Open karandatwani92 opened this issue 1 year ago • 6 comments

WHY

To address this #186

AFTER - What is happening after this PR?

Added --force argument to php artisan backpack:crud

Is it a breaking change or non-breaking change?

Non-breaking

How can we test the before & after?

php artisan backpack:crud item php artisan backpack:crud item --force

karandatwani92 avatar Mar 10 '23 13:03 karandatwani92

Awesome! Is this ready @karandatwani92 ? If so, please assign @pxpm to review, test and merge.

tabacitu avatar Mar 13 '23 07:03 tabacitu

Yes @tabacitu , this is ready for review.

Hey @pxpm, Please give it a read and test? Thanks 🙃

karandatwani92 avatar Mar 13 '23 08:03 karandatwani92

@pxpm,

I didn't knew backpack has following signatures: php artisan backpack:model php artisan backpack:request

And this doesn't exists php artisan backpack:controller

Docs only shows the following which i have already covered:

Command Description.
php artisan backpack:crud-controller Generate a Backpack CRUD controller.
php artisan backpack:crud-model Generate a Backpack CRUD model
php artisan backpack:crud-request Generate a Backpack CRUD request
php artisan backpack:crud-operation Generate a custom Backpack CRUD operation trait

karandatwani92 avatar Mar 14 '23 07:03 karandatwani92

I found these two were unmaintained and replaced by newer commands. So, as a final solution i have refactored these two to call newer backpack commands to keep up with newer functionalities.

php artisan backpack:model
php artisan backpack:request

karandatwani92 avatar Mar 15 '23 09:03 karandatwani92

I found these two were unmaintained and replaced by newer commands. So, as a final solution i have refactored these two to call newer backpack commands to keep up with newer functionalities.

php artisan backpack:model
php artisan backpack:request

I think this is not correct. backpack:model had a fix not so much time ago: https://github.com/Laravel-Backpack/Generators/commit/42d23045a3d84d0da41c7749e418a92916b649fb so there may be people still using that command.

If we plan do remove it in favor of the new command it need to be on a new version with a breaking change. Since we have only the "new commands" documented, and they do the same (or better) than the old ones, we can just add the --force to the new ones and leave the old ones untouched. Is there something that backpack:model does that backpack:crud-model don't ? what are the differences between them?

Cheers

pxpm avatar Apr 24 '23 11:04 pxpm

Hi @pxpm I rechecked, both used to do the same thing with no differences. So I think you can merge.

karandatwani92 avatar May 01 '23 11:05 karandatwani92