Return Data from Database with vue

Posted 3 months ago by simangae

Hi, I have two tables that has one to one relationship, when I try to access data from 2nd table, I get the "TypeError: Cannot read property 'bio' of null" .

Here my controller

return User::with('profile')->latest()->get();


public function profile(){ return $this->hasOne('App\StudentInfo'); }


axios.get("api/user").then(({ data }) => (this.users = data));


{{ }} {{ }} {{ }} {{ }} {{}} //This gives me error when I remove It's working fine
                       <a href="">
                            <i class="material-icons">mode_edit</i>
                       <a href="">
                            <i class="material-icons">delete</i>


Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.