Skip to content

docs: clarify use of hasOption()#54415

Merged
taylorotwell merged 2 commits into
laravel:11.xfrom
jezmck:patch-2
Jan 30, 2025
Merged

docs: clarify use of hasOption()#54415
taylorotwell merged 2 commits into
laravel:11.xfrom
jezmck:patch-2

Conversation

@jezmck
Copy link
Copy Markdown
Contributor

@jezmck jezmck commented Jan 30, 2025

hasOption() does not check whether the command has been called with the given option, but rather whether the command even accepts the option.

i.e. it is not like request()->has('option')
https://laravel.com/docs/11.x/requests#input-presence

`hasOption()` does not check whether the command has been _called_ with the given option, but rather whether the command even _accepts_ the option.
Comment thread src/Illuminate/Console/Concerns/InteractsWithIO.php Outdated
Co-authored-by: Sebastian Hädrich <11225821+shaedrich@users.noreply.github.com>
@taylorotwell taylorotwell merged commit 6cdef2c into laravel:11.x Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants