jeffharrell / minicart

The minicart is a great way to improve your PayPal shopping cart integration.
MIT License
501 stars 211 forks source link

send laravel token #310

Open mRamadan0101 opened 5 years ago

mRamadan0101 commented 5 years ago

how to use mini cart to form to send laravel token csrf_token

<input type="hidden" name="_token" value="{{ csrf_token() }}" />

FIRDOUS-BHAT commented 4 years ago

I'm looking for the same answer

FIRDOUS-BHAT commented 4 years ago

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,