Hey there, I have a scenario where I am fetching response data using Vue.js with Axios from Laravel:
Here is my example method in Vue.js:
getApps(page = 1){
axios.get('/api/getappforms')
.then(response =>
{
apps = response.data
}
).catch(err => console.log(err));
}
And here is my Laravel method:
$DataApps = Appclications::select('application.*','wilayas.name as wilaya','dairas.name as daira_field','communes.name as commune_field')
->leftJoin('dairas','dairas.id','=','application.id_daira')
->leftJoin('wilayas','wilayas.id','=','application.id_wilaya')
->leftJoin('communes','communes.id','=','application.id_commune')
->paginate(15);
return response()->json($DataApps);
Everything works perfectly, but I need to extract only the IDs from the 'apps' variable in Vue.js and store them in another array. Can anyone assist me with this?
Thanks in advance!