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

[5.5] Default value to true in session's Store::flash #18136

Merged
merged 1 commit into from
Feb 27, 2017
Merged

[5.5] Default value to true in session's Store::flash #18136

merged 1 commit into from
Feb 27, 2017

Conversation

sebastiandedeyne
Copy link
Contributor

This would be useful for cases in which you don't care about the actual contents of the flash message. Looks cleaner that assigning an arbitrary value like true, 'success' or 1.

E.g. if you want to display a notification if settings have been saved, and do nothing otherwise.

session()->flash('settings:saved')
@if(session()->has('settings:saved'))
    <div class="alert">Saved!</div>
@endif

@balping
Copy link
Contributor

balping commented Feb 27, 2017

The default should be null then. session()->has() would still give true.

@taylorotwell taylorotwell merged commit 7aced24 into laravel:master Feb 27, 2017
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

3 participants