Support the ongoing development of Laravel.io →
Database Architecture
Last updated 2 years ago.
0

I think the most easy thing to do is just make a pivot table, with a user_id, competition_id and a role and then you can do something like 1 is participant and 2 is a judge. Now for the data integrity, you can use something like SQL Triggers to prevent multiple rows from the same user for the same competition. But you can also just do that in Laravel which is much easier. So if you are adding a new entry to the pivot table, just check if there is already a row with that user and competition, and if so return false.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ChwanRen chwanren Joined 27 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.