lundi 30 mai 2016

Laravel Notifications system, reserved method?

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?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1WUZ7rF
via IFTTT

Aucun commentaire:

Enregistrer un commentaire