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

[8.x] Add missing method to session docs #6998

Merged
merged 2 commits into from
Apr 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion session.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ To determine if an item is present in the session, even if its value is `null`,
//
}

To determine if an item is not present in the session, you may use the `missing` method. The `missing` method returns `true` if the item is `null` or if the item is not present:

if ($request->session()->missing('users')) {
//
}

<a name="storing-data"></a>
### Storing Data

Expand Down Expand Up @@ -179,7 +185,7 @@ The `pull` method will retrieve and delete an item from the session in a single

If your session data contains an integer you wish to increment or decrement, you may use the `increment` and `decrement` methods:

$request->session()->increment('count');
$request->session()->increment('count');

$request->session()->increment('count', $incrementBy = 2);

Expand Down