I have a schools table with list of schools in it but some schools are related to each other meaning school A can be related to school B and C and in this relation it also means there is a relation between all the schools and one another means it can be it can be like its primary,secondary and high school so they are all one. What i want is how can i store this relation so that when i am in B i can call its branches as C and A, and them same when i am in C i can call on B and A.
What i have tried is i have a school_branches table but in this i have saved initial school and branch school. What now happens is i have shown relation between A and B, and A and C, but no relation between B and C i see that i am going to end up with redundancy so as of now i can only call relation of A to the others but not the other way around, what can i do. I am using laravel.