Try with using Polymorphic Relationship.
BelongsToMany with pivot custom date
Hi,
I don’t know how to realise my relation :
I have 3 tables : - user : id, name,... - status: id, name, value - state_user: user_id, staus_id, status_date
In my state_user table i have some datas like :
user_id | staus_id | status_date 1 | 8 | 2019-05-21 15:45:541000 2 | 1 | 2019-05-21 12:13:187000 1 | 1 | 2019-05-22 08:54:167000 1 | 1 | 2019-05-23 10:12:542000
I want make relation between each user and his daily status. Also, i want sync new relation if doesn't exists for current day.
Someone have idea to do this ?
Thanks for your help.
PS : Sorry for my bad english... :)
Please or to participate in this conversation.