laravel-zero
laravel-zero copied to clipboard
[Support] Cannot Hide db:wipe command
Apologies if this has been asked before, I am trying to build a phar for dsitribution that will ship with a migrated db.
I am trying to hide db:wipe from the command list when the application is called, I have added Illuminate\Database\Console\WipeCommand::class to either and then both of the hidden and remove arrays in commands.php with no luck
I ran into the same issue today.
I am running into the same issue.
@robertmarney @chrisbradleydev @etyson17 Can one of you work on pull request please?
@nunomaduro would you please point us in the right direction?
Is this functionality in the framework repository?
Or would it be here?
https://github.com/nunomaduro/laravel-console-summary
@nunomaduro I have been able to hide the db:wipe command by removing the protected static $defaultName = 'db:wipe'; and #[AsCommand(name: 'db:wipe')].
Is there a test I can run to ensure this is not going to break anything?
https://github.com/illuminate/database/blob/9.x/Console/WipeCommand.php#L10-L31
@nunomaduro
I can confirm this behavior, although I'm not certain this is an acceptable solution.
If I comment lines 7, 10, and 31 in https://github.com/illuminate/database/blob/9.x/Console/WipeCommand.php and add Illuminate\Database\Console\WipeCommand::class to removed commands in my Laravel Zero project, it removes the db:wipe command from the CLI menu.
It appears that lines 7 & 10 were added back in April but I am unsure why. Any clarification would be extremely helpful.
Here is where they were added: https://github.com/laravel/framework/pull/41982
Thanks for the investigation to date, I am going to monitor the discussion at https://github.com/laravel/framework/pull/41982 and see what comes from there.
@nunomaduro - My understanding is that Zero executes an artisan list and then wraps the result, if so then a good path forward might be to handle the exclusion after that function is processed?
Hello @nunomaduro , I just fix this issue and make a pull request, could you have a look? Thank you.
Hi @robertmarney, this should now be resolved in the latest version of the framework. 👍🏻 (At least, using hidden). Let me know if you have any further issues.