diff --git a/session.md b/session.md index e4cb057492..30ccf495f9 100644 --- a/session.md +++ b/session.md @@ -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')) { + // + } + ### Storing Data @@ -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);