You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Fields/BelongsToMany.php
+2-6Lines changed: 2 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,6 @@
9
9
useClosure;
10
10
useIlluminate\Auth\Access\AuthorizationException;
11
11
useIlluminate\Http\Request;
12
-
useIlluminate\Support\Facades\Gate;
13
12
14
13
class BelongsToMany extends EagerField
15
14
{
@@ -64,11 +63,8 @@ public function resolve($repository, $attribute = null)
64
63
->resolveFromPivot($item->pivot)
65
64
)
66
65
->eagerState();
67
-
} catch (AuthorizationException$e) {
68
-
$class = get_class($item);
69
-
$policy = get_class(Gate::getPolicyFor($item));
70
-
71
-
abort(403, "You are not authorized to see the [{$class}] relationship from the HasMany field from the BelongsTo field. Check the [show] method from the [$policy]");
@@ -46,11 +45,8 @@ public function resolve($repository, $attribute = null)
46
45
return$this->repositoryClass::resolveWith($item)
47
46
->allowToShow(app(Request::class))
48
47
->eagerState();
49
-
} catch (AuthorizationException$e) {
50
-
$class = get_class($item);
51
-
$policy = get_class(Gate::getPolicyFor($item));
52
-
53
-
abort(403, "You are not authorized to see the [{$class}] relationship from the HasMany field from the BelongsTo field. Check the [show] method from the [$policy]");
0 commit comments