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

By what I've understood your relationship should look this:

  • User belongsTo Department
  • User belongsTo Rank
  • Department hasMany User
  • Rank hasMany User

Sorry if I misunderstood your project.

Last updated 7 years ago.
0

Clarification:

  • Users Table:

    • department_id
    • rank_id
  • Departments Table:

    • id
    • name
      • The name here will have another table to go with it (example: example_department.)
  • example_department Table:

    • rank_id
    • rank_name
    • department_id
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Austin Sharp Austin Sharp asharp Joined 2 Jul 2017

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.