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
Specify commands that will not be available on http calls #89
Conversation
Thanks! I'd don't see any difference in handling compared to our current method: https://github.com/spatie/laravel-package-tools/pull/89/files#diff-019f7c923ae71364e0c7e058efe9cd6c43a4955d8c5b6461b2a69e3f04979bcfR101-R108 |
@freekmurze hi, thanks for answer
in that PR it was added that all the commands can be executed from the context of http calls, Example: laravel-package-tools/src/Package.php Lines 69 to 73 in d7ea4f7
Here is the conditional
I will modify the PR for better readability |
d6c08be
to
8bf8b7a
Compare
src/Package.php
Outdated
@@ -163,9 +165,9 @@ public function hasMigrations(...$migrationFileNames): static | |||
return $this; | |||
} | |||
|
|||
public function hasCommand(string $commandClassName): static | |||
public function hasCommand(string $commandClassName, bool $justConsole = false): static |
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.
Is this flag
being used somewhere? Seems like the dedicated hasConsoleCommand
already covers this functionality. Could you remove the flag?
8bf8b7a
to
2b74583
Compare
Seems like the tests are failing, could you have a look |
2b74583
to
75ff7ef
Compare
Thanks! |
There are some commands that should not be able to be executed from the context of web application interfaces, like InstallCommand, NetworkCommand
This PR gives us the option to register commands that will exclusively be used from the console.
Also on laravel documentation there is an example https://laravel.com/docs/10.x/packages#commands (runningInConsole)
Example:
This was broken here: #23