I'm getting error when i want to fetch my data from table.
My controller :
public function admin()
{
$users = User::with('subs')->get();
//dd($users);
return view('admin')->response()->json([
'users' => $users,
], 200);
}
My vue.js script :
<script>
export default {
data(){
return{
users: []
}
},
methods: {
showUsers(){
axios.get('admin/routes').then(response => {
this.users = response.data.users;
});
}
},
mounted(){
this.showUsers();
}
}
</script>
My blade html code:
<tr v-for="user in users">
<td></td>
<td></td>
</tr>
Method Illuminate\View\View::response does not exist.
when i want to fetch my data from table.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire