Is it only ever going to be created_by
and updated_by
? What happens if multiple users update the package, you only want to track the person who updated it last?
If so, then your design can just be this without the need for a pivot table:
Customers
-----------
id
name
Packages
-----------
id
name
created_by (customer_id)
updated_by (customer_id)
However, if you'd like to track all users that update a package, you could do something like this:
Customers
-----------
id
name
Packages
-----------
id
name
created_by (customer_id)
Pivot (tracking updates)
-----------
customer_id (primary key)
package_id (primary key)
updated_at (timestamp)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community