Skip to content
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

[11.x] Add Context "missing" method #54499

Merged
merged 5 commits into from
Feb 7, 2025

Conversation

vbergerondev
Copy link
Contributor

@vbergerondev vbergerondev commented Feb 7, 2025

I tried using the missing method on the Context facade and was surprised to find it didn’t exist. Other facades like Cache and Session have it, so it felt natural to expect it here too.

This PR adds the missing method to keep things consistent and make life a little easier for developers.

If this gets merged I'll create a PR to the docs too!

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link

github-actions bot commented Feb 7, 2025

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@vbergerondev vbergerondev marked this pull request as ready for review February 7, 2025 01:32
@donnysim
Copy link
Contributor

donnysim commented Feb 7, 2025

If you want to keep this consistent you should check if it's null, not if its falsy as 0, false, '' also will return as missing.

vbergerondev and others added 3 commits February 7, 2025 06:35
Fix
@taylorotwell taylorotwell merged commit 454eb0d into laravel:11.x Feb 7, 2025
@vbergerondev vbergerondev deleted the add-context-missing-method branch February 7, 2025 16:13
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.

None yet

4 participants