Skip to content

Commit 24426b6

Browse files
committed
Fix runtime error when authorization fails.
1 parent 5ea0264 commit 24426b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

laravel/src/SyncableModelHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace JamesWildDev\ReactNativeAppHelpers;
44

55
use Illuminate\Database\Eloquent\ModelNotFoundException;
6-
use Illuminate\Validation\UnauthorizedException;
6+
use Illuminate\Auth\Access\AuthorizationException;
77

88
/**
99
* Helpers for working with syncable models.
@@ -77,7 +77,7 @@ static function upsert(
7777

7878

7979
if ($query->where('uuid', $uuid)->exists()) {
80-
throw new UnauthorizedException();
80+
throw new AuthorizationException();
8181
} else {
8282
return null;
8383
}

0 commit comments

Comments
 (0)