-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --force argument to php artisan backpack:crud #187
base: main
Are you sure you want to change the base?
Conversation
Awesome! Is this ready @karandatwani92 ? If so, please assign @pxpm to review, test and merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @karandatwani92 thanks for the clean solution.
I've just added one suggestion to make it more similar to what we already have, small detail, nothing special.
Everything seems to be working as expected, good job 🙏
I tried the same with php artisan backpack:model SomeModel
expecting it would also work. Sadly it doesn't.
I think if we are adding the --force
option we should do it consistently.
If you can force a model to regenerate during a :crud
command, you should also be able to force generation when using it the single command :model
. Same for :request
and :controller
.
At least those because are the ones that we are introducing the --force
option via :crud
command.
What do you think ?
Cheers 🙏
@@ -52,14 +52,14 @@ public function handle() | |||
} | |||
|
|||
// Create the CRUD Model and show output | |||
$this->call('backpack:crud-model', ['name' => $name]); | |||
$this->call('backpack:crud-model', ['name' => $nameTitle, '--force' => $this->option('force')]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably store the --force
option up close where we init other command properties like $name
, $nameTitle
etc. We then re-use the variable across the command 👍 This is just personal preference, it's not that is bad implemented.
$this->call('backpack:crud-model', ['name' => $nameTitle, '--force' => $this->option('force')]); | |
$this->call('backpack:crud-model', ['name' => $nameTitle, '--force' => $force]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also take a look at this @karandatwani92 let me know if you think we shouldn't do this, otherwise please do it 👍
I didn't knew backpack has following signatures: And this doesn't exists Docs only shows the following which i have already covered:
|
I found these two were unmaintained and replaced by newer commands.
|
I think this is not correct. If we plan do remove it in favor of the new command it need to be on a new version with a breaking change. Cheers |
Hi @pxpm |
WHY
To address this #186
AFTER - What is happening after this PR?
Added
--force
argument tophp 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