All individual subscriptions are 50% off this week only!

hachich46
2 years ago

One table with multiple pivots tables

Posted 2 years ago by hachich46

Hi everyone, these are relations in my models :

  • Medecine belongsto many Pharmaceutic and Pharmaceutic belongsto many Medecine
  • Medecine belongsto many Therapeutic and Therapeutic belongsto many Medecine
  • Medecine belongsto many Galenic and Galenic belongsto many Medecine
  • Medecine belongsto many AdministrationMode and AdministrationMode belongsto many Medecine
  • Medecine belongsto many ActivePrinciple and ActivePrinciple belongsto many Medecine

Pharmaceutic is working faster in all case -:)

My problem is there, when i execute this type of query in my controller for other relations :

    $Galenic= Galenic::Find(1);

    $Medecines= $Galenic->medecines()->orderBy('field1', 'asc')
    ->paginate(10);

return view('page', compact('Medecines'));

The view is generating data results witout any error but is STILL LOADING FOR SEVERAL MINUTES. What im missing ?

I think that i was clear

Help me please !

Please sign in or create an account to participate in this conversation.