So i am trying to fetch data in my vue component as you can see below. But because iam reqesting the fetch from my blade view in public/manage-users-projects the url becomes
http://localhost:8080/ProjsiteWebApp/app/public/manage-users-projects/get-projects-json
but i want to fetch data from this url
http://localhost:8080/ProjsiteWebApp/app/public/get-projects-json
So i can i sort of return one route and execute from the public folder?
export default {
created(){
this.fetchProjects();
},
methods:{
fetchProjects() {
fetch('get-projects-json')
.then(res => res.json())
.then(res => {
console.log(res.data);
})
}
}
};
Route::get('get-projects-json', 'ProjectsController@getProjectsJson');