Skip to content

Commit f9bba44

Browse files
committed
Fix old docs references to $request
1 parent 497cd36 commit f9bba44

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

docs/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Optionally pass a closure that returns a boolean value.
88
$type->creatable();
99

1010
$type->creatable(function (Context $context) {
11-
return $request->getAttribute('user')->isAdmin();
11+
return $context->getRequest()->getAttribute('user')->isAdmin();
1212
});
1313
```
1414

docs/delete.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Optionally pass a closure that returns a boolean value.
88
$type->deletable();
99

1010
$type->deletable(function (Context $context) {
11-
return $request->getAttribute('user')->isAdmin();
11+
return $context->getRequest()->getAttribute('user')->isAdmin();
1212
});
1313
```
1414

docs/list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If you want to restrict the ability to list a resource type, use the `listable`
88
$type->notListable();
99

1010
$type->listable(function (Context $context) {
11-
return $request->getAttribute('user')->isAdmin();
11+
return $context->getRequest()->getAttribute('user')->isAdmin();
1212
});
1313
```
1414

docs/update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Optionally pass a closure that returns a boolean value.
88
$type->updatable();
99

1010
$type->updatable(function (Context $context) {
11-
return $request->getAttribute('user')->isAdmin();
11+
return $context->getRequest()->getAttribute('user')->isAdmin();
1212
});
1313
```
1414

docs/visibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ For example, the following schema will make an email attribute that only appears
99
```php
1010
$type->attribute('email')
1111
->visible(function ($model, Context $context) {
12-
return $model->id === $request->getAttribute('userId');
12+
return $model->id === $context->getRequest()->getAttribute('userId');
1313
});
1414
```
1515

0 commit comments

Comments
 (0)