I have 2 buttons for 2 modals . in below code :
<div>
<h3>1 month</h3>
<button type="button" class="pay-btn-1" data-toggle="modal" data-target="#modal1">Pay this featur</button>
</div>
<div>
<h3>2 month</h3>
<button type="button" class="pay-btn-2" data-toggle="modal" data-target="#modal2">Pay this featur</button>
</div>
I insert 2 modals in the footer :
<------ Modal 1------->
<div id="modal1" class="modal fade" role="dialog">
<div class="modal-dialog">
<?php
Session::flush('month');
Session::put('month', 1);
?>
<!-- Modal content-->
<div class="modal-content">
<form action="{{ route('panel.vip.payment') }}" method="post">
@csrf
<input type="hidden" value="1" name="plan">
<div>
<button type="submit">pay</button>
</div>
</form>
<button type="button" data-dismiss="modal">close</button>
</div>
</div>
</div>
<------ Modal 2------->
<div id="modal2" class="modal fade" role="dialog">
<div class="modal-dialog">
<?php
Session::flush('month');
Session::put('month', 2);
?>
<!-- Modal content-->
<div class="modal-content">
<form action="{{ route('panel.vip.payment') }}" method="post">
@csrf
<input type="hidden" value="2" name="plan">
<div>
<button type="submit">pay</button>
</div>
</form>
<button type="button" data-dismiss="modal">close</button>
</div>
</div>
</div>
I want to clear the month
session when any of the pay buttons are clicked and then the value for that button (1 or 2) set in the month
session
How can I do this?
Thanks.