Я пытаюсь получить данные в своей таблице Personal-Information
У ведьмы есть внешний ключ как user_id
из таблицы user
, но я не могу получить его. Кто-нибудь знает, как?
public function personal()
{
return $this->hasOne(Personal::class);
}
ШАБЛОН МОЕГО ВИДА
export default {
data(){
return{
form: new Form({
id: '',
name: '',
surname: '',
identity: '',
birthday: '',
country: '',
province: '',
county: '',
telemovel: '',
address: '',
facebook: '',
tweet:'',
linkedin: '',
})
}
},
methods:{
loadUsers(){
axios.get("api/personal").then(({ data }) => (this.form.fill(data)));
},
createUser(){
this.form.post('api/personal')
},
},
created(){
this.loadUsers();
},
mounted() {
console.log('Component mounted.')
}
}