[L5] Avoiding CSRF middleware on API POST routes

Posted 4 years ago by alexleonard

I've just started setting up an API in an L5 application and if I try to create a POST route on the API I instantly get TokenMismatchException in VerifyCsrfToken.php line 45

I did notice this laravel/laravel commit today which I'm guessing is probably related.

Anyone know how to stop CSRF verification from being called on certain routes, or do I need to wait to see how the cookie will crumble?

Thanks!

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.