Level 55
@muazzamazaz in you case it make sence to eager load tankno with fdetail data instead of doing ajax call for every single row
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have to get data from the Laravel model function.
public function getTank($id)
{
$tank = Tank::find($id);
return $tank->tankno;
}
For this, the following function is being called.
async function getTank(tank){
let url = '/gettank/'+tank;
let abc= await axios.get(url)
.then(function(response){
return (response.data);
})
.catch(function(error){
console.log(error);
});
return(abc)
}
and passing tankno from vue code
<tr v-for="(item, index) in fdetail" :key="item.id">
<td>
{{getTank(item.id)}}
</td>
</tr>
I want to display returned data but the result is Promise Object.
Please or to participate in this conversation.