I am trying to fetch data from database using AXIOS get request.i have 2 models (Content and Word)having many to many relationships. in my controller I am trying this :
public function fetchCourses(){
$dayOne = Content::where(['course_id'=>'1','day_id'=>'1'])->first();
return $dayOne;
}
in vue i am trying like this :
axios.get('/getCourse').then((response)=>{
//console.log(response.data);
this.content = response.data;
})
Then in the component :
<iframe width="560" height="315" :src="content.video_clip" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
video_clip is one of the column names in my Contents table.
Now I want to fetch not only contents but words also from Word Model. How can I achieve this?