I am not able to pass an array of strings through an ajax call to a Route.
The route definition is:
Route::get('api/taxonomytospecies/{ids}', 'TaxonomyController@getSpeciesFromTaxonomy');
The vue defintion is:
var data = { ids : checked_leaves };
console.log(this.el.action);
this.vm.$http.get(this.el.action+'/:ids', {ids : 1}).then((response) => {
// Inside the response data there are also the taxonomy data, but the google map API cna distinguish by itself
console.log(JSON.parse(response.data));
//this.vm.speciesDetails = JSON.parse(response.data);
//this.vm.loading = false;
}, (response) => {
});
The controller method is:
public function getSpeciesFromTaxonomy(Request $request) {
return json_encode($request->get('ids'));
}
In the HTML I have
<form method="GET" action="api/taxonomytospecies" v-ajax>
.....
The array i should wens id checked_leaves, but I am making a simpler attempt just to receive what i send through vue-resource and the response.data is always null