Repository navigation
Base the install command on package-tools' InstallCommand - #24
Merged
Merged
Conversation
Moves the captcha install command onto laranail/package-tools' install base while keeping laranail/console's display API through its two traits, so neither package gains a dependency on the other. Observable behaviour is unchanged: the name, the --migrations option, the description, listing visibility (passed explicitly, since the base hides install commands by default), the output and the exit codes. A contract test pins all of them and passed against the previous base before the swap. The command is bound in the container because the new base takes the Package in its constructor, which keeps it registered by class name and constructed only when Artisan resolves it.
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves
laranail::captcha.installonto laranail/package-tools'InstallCommandbase, keeping laranail/console's display API ($this->services) and managed run lifecycle byuse-ing itsInteractsWithConsoleServicesandInteractsWithConsoleWritertraits. No new dependency direction: captcha already requires both packages, and neither of them gains a dependency on the other.What stays the same
laranail::captcha.install, no aliases, the same description.--migrations(no value), no arguments.php artisan list. The base hides install commands by default, sohidden: falseis passed explicitly.unknownprovider fallback.handle()is unchanged. The base's generic publish pipeline is not used, because it would print different steps.How
InstallCommandextends the package-tools base, passes its own signature andhidden: false, and restores its description after the base writesInstall laranail/captcha.Packagein its constructor, which the container cannot autowire, sopackageRegistered()binds the command. It stays registered by class name inhasCommands(), constructed only when Artisan resolves it, exactly as before.Tests
InstallCommandContractTestpins the name, aliases, description, visibility, options and arguments, the output with and without--migrations, the unknown-provider line, and asserts the class extends the package-tools base and uses both console traits. The behaviour pins passed against the old base before the swap; the inheritance assertion failed there, as intended.