Skip to content

Commit 3dfcf8c

Browse files
committed
🐛 base model on resource instead of response
1 parent d3b7132 commit 3dfcf8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Http/Response.php

Lines changed: 1 addition & 1 deletion
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)