Skip to content

Commit 3a19b52

Browse files
[12.x] Add except method in Context (#10388)
* Update context.md * Update context.md * Update context.md * Update context.md --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 1eb8905 commit 3a19b52

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

context.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,12 @@ use Illuminate\Support\Facades\Context;
266266
$value = Context::get('key');
267267
```
268268

269-
The `only` method may be used to retrieve a subset of the information in the context:
269+
The `only` and `except` methods may be used to retrieve a subset of the information in the context:
270270

271271
```php
272272
$data = Context::only(['first_key', 'second_key']);
273+
274+
$data = Context::except(['first_key']);
273275
```
274276

275277
The `pull` method may be used to retrieve information from the context and immediately remove it from the context:

0 commit comments

Comments
 (0)