How to make guest-only api endpoints
Via web route, if i want a route to be guest only, i use the guest middleware.
Via api route, how this can be achieved?
9 Replies
bump
Don't use
auth
?yeah but that will just allow guest users too
i want to block auth users
like web guest route, but in api
or i dont find the middleware for it or is not commonly used and therefore there is not a guest api middleware by default
Then create a new middleware that blocks auth users?
πyeah
but
i asked just in case this already existed somehow
so i dont reinvent the wheel u know
Dude.
abort_if(auth()->check())
yes dennis π
π
xD
thanks for the help, was just this