@kvnkrft Well, the error message is telling you what the issue is:
Avoid placing tags with side-effects in your templates, such as , as they will not be parsed.
The form contains a <script> tag.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm trying to follow the Laracasts video for stripe (https://laracasts.com/lessons/painless-subscriptions-with-laravel-and-stripe), but "my button" does not open a Stripe checkout modal, but rather redirects to the action. There also is no data in the $request on the other side. I'm guessing my issue is related to VUE stuff - which I haven't touched at all and find to be a bit of a hurdle (for a beginner).
I see this error in my browser console:
[Vue warn]: Error compiling template:
...
- Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.
Here is my form, just a copy/paste from Stripe (https://stripe.com/docs/checkout/tutorial):
<form action="/pay" method="POST">
{{ csrf_field() }}
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_4CGhkyhXXXXzRtFnaPo7RWVM"
data-amount="999"
data-name="Demo Site"
data-description="Widget"
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
data-locale="auto"
data-currency="cad">
</script>
</form>
Am I on the right track? Do I need to mess with this VUE business to get this to work?
Incase someone else comes across the same issue, here's what is working for me. I got help from someone - not on here - thank you.
<div class="row">
<div class="col-md-4"><h2>Subscription</h2></div>
<div class="col-md-8">
<button class="btn btn-primary" id="purchase-button">Purchase</button>
@push('scripts')
<script src="https://checkout.stripe.com/checkout.js"></script>
<script>
const handler = StripeCheckout.configure({
key : 'pk_test_4CGhk########Po7RWVM',
image : 'https://stripe.com/img/documentation/checkout/marketplace.png',
locale: 'auto',
token : function (token) {
console.log(token);
}
});
document.getElementById('purchase-button').addEventListener('click', function (e) {
handler.open({
name : 'Company Name',
description: 'Service Description',
amount : 2000,
currency : 'usd',
locale : 'auto',
});
e.preventDefault();
});
// Close Checkout on page navigation:
window.addEventListener('popstate', function () {
handler.close();
});
</script>
@endpush
</div>
</div>
Please or to participate in this conversation.