Skip to content

Commit d67f3d3

Browse files
authored
Merge pull request #33 from Lomkit/fix/relation-limit
🐛 base model on resource instead of response
2 parents 62c469d + 3dfcf8c commit d67f3d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Http/Response.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function toResponse($request) {
125125
$this->responsable->getOptions(),
126126
$this->resource->isAutomaticGatingEnabled() ? [
127127
config('rest.automatic_gates.key') => [
128-
config('rest.automatic_gates.names.authorized_to_create') => Gate::allows('create', $this->responsable->first()::class),
128+
config('rest.automatic_gates.names.authorized_to_create') => Gate::allows('create', $this->resource::newModel()::class),
129129
]
130130
] : []
131131
);

0 commit comments

Comments
 (0)