Skip to content

Commit 137c840

Browse files
Introduction support popping items from stackable context item (laravel#10014)
* Introduction support popping items from stackable context item Documentation update for changes introduced in laravel/framework#53403 * Update context.md * Update context.md * Update context.md --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent f3f131a commit 137c840

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

context.md

+13
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,18 @@ The `pull` method may be used to retrieve information from the context and immed
229229
$value = Context::pull('key');
230230
```
231231

232+
If context data is stored in a [stack](#stacks), you may pop items from the stack using the `pop` method:
233+
234+
```php
235+
Context::push('breadcrumbs', 'first_value', 'second_value');
236+
237+
Context::pop('breadcrumbs')
238+
// second_value
239+
240+
Context::get('breadcrumbs');
241+
// ['first_value']
242+
```
243+
232244
If you would like to retrieve all of the information stored in the context, you may invoke the `all` method:
233245

234246
```php
@@ -305,6 +317,7 @@ Context::addHiddenIf(/* ... */);
305317
Context::pushHidden(/* ... */);
306318
Context::getHidden(/* ... */);
307319
Context::pullHidden(/* ... */);
320+
Context::popHidden(/* ... */);
308321
Context::onlyHidden(/* ... */);
309322
Context::allHidden(/* ... */);
310323
Context::hasHidden(/* ... */);

0 commit comments

Comments
 (0)