3 weeks ago

Laravel 8.x 419 "CSRF token mismatch"

Posted 3 weeks ago by pn

I am using Laravel only as api and php file, jquery as frontend.

I am using jquery ajax.

I know that I should be passing the x-csrf_token.

But issue is that I do not get x-csrf-token in meta tag printed, I tried using this in my front end php file :

<meta name="csrf-token" content="<?php echo csrf_token(); ?>

But that stopped loading my frontend.

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