Skip to content

Commit fb9b29d

Browse files
[11.x] Add documentation for Context::missing() (#10154)
* add documentation for missing method * Update context.md --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 381d364 commit fb9b29d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

context.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,18 @@ $data = Context::all();
250250
<a name="determining-item-existence"></a>
251251
### Determining Item Existence
252252

253-
You may use the `has` method to determine if the context has any value stored for the given key:
253+
You may use the `has` and `missing` methods to determine if the context has any value stored for the given key:
254254

255255
```php
256256
use Illuminate\Support\Facades\Context;
257257

258258
if (Context::has('key')) {
259259
// ...
260260
}
261+
262+
if (Context::missing('key')) {
263+
// ...
264+
}
261265
```
262266

263267
The `has` method will return `true` regardless of the value stored. So, for example, a key with a `null` value will be considered present:

0 commit comments

Comments
 (0)