You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: context.md
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -293,6 +293,14 @@ Context::get('breadcrumbs');
293
293
// ['first_value']
294
294
```
295
295
296
+
The `remember` and `rememberHidden` methods may be used to retrieve information from the context, while setting the context value to the value returned by the given closure if the requested information doesn't exist:
297
+
298
+
```php
299
+
$permissions = Context::remember('user-permissions', function () use ($user) {
300
+
return $user->permissions;
301
+
});
302
+
```
303
+
296
304
If you would like to retrieve all of the information stored in the context, you may invoke the `all` method:
0 commit comments