Skip to content

Apply middleware to all but one Nova routes #3798

Answered by jolora
jolora asked this question in Q&A
Discussion options

You must be logged in to vote
public function handle(Request $request, Closure $next)
    {
        if($request->is('my-tool-route')) {
           return $next($request);
        }

       [...]
}

Finally thought of the obvious solution... added the above to the beginning of my middleware. Previously had tried this with $request->get_path() but that didn't work for some reason.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jolora
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jolora
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants