Когда я использую axios, я получаю эту ошибку:
[Vue warn]: ошибка в созданном хуке: «Ошибка типа: невозможно прочитать свойство 'get' of undefined"
export default {
methods: {
loadUsers(){
axios.get("api/user").then(data => (this.users = data));
}
},
created() {
this.loadUsers();
}
}
Маршруты:
api.php
Route::apiResources(['user' => 'API\UserController']);
Контроллер:
API / UserController.php
public function index()
{
return User::latest()->paginate(5);
}