I have user and post models have this relation:
// BlogPost
public function author() {
return $this->belongsTo('App\User');
}
// User
public function articles() {
return $this->hasMany('App\BlogPost');
}
In database I have "blog_posts" table with "author_id" field, but Laravel returns this error:
"Column not found: 1054 Unknown column 'user_id' in 'field list'".
What can I do?!
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1VGEGuG
via IFTTT
Aucun commentaire:
Enregistrer un commentaire