I am building a simple notifications system in laravel for my users.
I created the notifications table and I'm linking it to user model using:
public function notifications(){
return $this->hasMany('App\Notification','user_id');
}
When I call this, it returns null, even when there are notifications.. Now, if I change it to this:
public function the_notifications(){
return $this->hasMany('App\Notification','user_id');
}
It works fine.
What's going on?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire