0👍
✅
You may try the following
<form method="POST">
<input type="hidden" name="_token" id="token" value="{{ csrf_token() }}">
<div class="col-md-4 col-sm-6 feature text-center">
<div class="content">
<button class="btn btn-default btn-question"
v-on="click: search(1, $event)">Category 1
</button>
</div>
</div>
<div class="col-md-4 col-sm-6 feature text-center">
<div class="feature-content">
<button class="btn btn-default btn-question"
v-on="click: search(2, $event)">Category 2
</button>
</div>
</div>
<div class="col-md-4 col-sm-6 feature text-center">
<div class="feature-content">
<button class="btn btn-default btn-question"
v-on="click: search(3, $event)">Category 3
</button>
</div>
</div>
</form>
And in your js file
Vue.http.headers.common['X-CSRF-TOKEN'] = document.querySelector('#token').getAttribute('value');
new Vue({
el: '#picker',
methods:{
search: function(id, e){
e.preventDefault();
var getresults = this.$http.get('api/products/' + id, function(products){
this.$set('products', products);
});
}
}
});
Source:stackexchange.com