minicart icon indicating copy to clipboard operation
minicart copied to clipboard

How to pass laravel CSRF token in it?

Open FIRDOUS-BHAT opened this issue 5 years ago • 1 comments

FIRDOUS-BHAT avatar Jan 25 '20 06:01 FIRDOUS-BHAT

I solved it! In minicart.js, I fetched the token value like this,

const token = $('input[name=_token]').val()

and gave this in template attribute within the form,

FIRDOUS-BHAT avatar Jan 25 '20 06:01 FIRDOUS-BHAT