-
|
I have an endpoint like so: I'm getting stuck on this as authorize is static, so it doesn't have access to my properties, is there something within this library that make this possible? Thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
elomonaco
Mar 10, 2026
Replies: 1 comment
-
|
Guess I should have dug a bit deeper, I figured it out, here is the solution I came up with: public static function authorize(): bool
{
$userId = (int) request()->route('userId');
return $userId === Auth::user()->id;
}hopefully it helps someone else |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
elomonaco
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Guess I should have dug a bit deeper, I figured it out, here is the solution I came up with:
hopefully it helps someone else☺️