Skip to content

Commit f29e114

Browse files
authored
Update button.blade.php
Ability to pick form posting method
1 parent 1deea5b commit f29e114

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/resources/views/button.blade.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@
1212
if(empty($size)){
1313
$size = 'responsive';
1414
}
15+
if(empty($method)){
16+
$method = 'POST';
17+
}
1518
?>
1619
<div v-pre rel="brainblocks-button" data-id="{{ $buttonId }}" data-amount="{{ $amount }}" data-destination="{{ $destination }}" data-currency="{{ $currency }}" data-size="{{ $size }}" data-expanded="{{ $expanded }}" id="{{ $buttonId }}-button"></div>
17-
<form action="{{ $action }}" method="POST" id="{{ $buttonId }}-form">
20+
<form action="{{ $action }}" @if($method == 'GET') method="GET" @else method="POST" @endif id="{{ $buttonId }}-form">
21+
@if(!in_array($method,['GET','POST']))
22+
<input type="hidden" name="_method" value="{{ $method }}" />
23+
@endif
1824
<input type="hidden" name="brainblocks_token" id="{{ $buttonId }}-token" value="" />
1925
{{ csrf_field() }}
2026
</form>

0 commit comments

Comments
 (0)