mercredi 25 mai 2016

Aggregation relationships (two or more) between two tables in laravel 5

I am developing a web app using laravel 5. Now i am having a issue below:

  • I have two table users and feedbacks

    • users: id, username, password

    • feedbacks: id, provider, receiver, reviewer, content

  • I want to provider, receiver and reviewer is a user. Meaning i will storage user'id into provider, receiver and reviewer.

  • In laravel, i only can setup a relationship for model User like: $this->belongsTo('User', 'provider', 'id')

  • And i want to receiver and reviewer also have belongsTo relationship

  • I thought creating the third table for many to many relationship, but if i do it, i must create two tables for receiver and reviewer.

I need helping to solve this isses without using more querys on controller, thanks for reading :D



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

Aucun commentaire:

Enregistrer un commentaire