I am looking for a way to pass data from Vue to PHP. So currently I am receiving a JSON object using a PHP query. It looks like:
<?php echo getBhQuery('search','JobOrder','isOpen:true','id,title,categories,dateAdded,externalCategoryID,employmentType,customText12', null, 200, '-dateAdded');?>
I also have inputs in my Vue app where I want to send data to that PHP query when the user uses the input. From there I want to rerun that PHP query with the added data.
I can filter the JSON object directly adding something to the PHP query to filter it like so:
<?php echo getBhQuery('search','JobOrder','isOpen:true AND customText12:"Chicago Region"','id,title,categories,dateAdded,externalCategoryID,employmentType,customText12'); ?>
So by adding 'AND customText12:"Chicago Region"' I would only get a JSON object with items that have their region set to Chicago Region. I'm just not sure the correct way in Vue to pass data to this PHP query and then rerun that query without refreshing the page. I assume I would need to use ajax or Axios or something like that, but so far I have not had any luck doing this with them and haven't found much online in the way of doing this in Vue.
TLDR: How to pass data from Vue to PHP in a fashion like Ajax.