Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[11.x] Add default value for get and getHidden on Context #50824

Merged
merged 2 commits into from
Mar 29, 2024
Merged

[11.x] Add default value for get and getHidden on Context #50824

merged 2 commits into from
Mar 29, 2024

Conversation

michaelnabil230
Copy link
Contributor

This PR adds a default value for get and getHidden on Context

Before:

$isUser = Context::get('is_user'); //  If is not has in array return null forever
$isUser = Context::getHidden('is_user'); //  If is not has in array return null forever

After:

$isUser = Context::get('is_user', false); // If is not has in array return false
$isUser = Context::getHidden('is_user', false); // If is not has in array return false

@taylorotwell taylorotwell merged commit 61f3908 into laravel:11.x Mar 29, 2024
18 of 19 checks passed
@michaelnabil230 michaelnabil230 deleted the add-default-value-context branch March 29, 2024 14:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants