Skip to content

Commit

Permalink
call authorize() via the container
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmastech authored Dec 5, 2024
1 parent fee5f63 commit a60ee0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DataPipes/AuthorizedDataPipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function handle(
protected function ensureRequestIsAuthorized(string $class): void
{
/** @psalm-suppress UndefinedMethod */
if (method_exists($class, 'authorize') && $class::authorize() === false) {
if (method_exists($class, 'authorize') && app()->call([$class, 'authorize']) === false) {
throw new AuthorizationException();
}
}
Expand Down

0 comments on commit a60ee0f

Please sign in to comment.