Hello guys i have issue here. For example I have the following tables
accounts, -> hasManyToMany providers providers, -> hasManyToMany accounts accounts_providers -> belongsTo accounts,providers
And these 3 models
Accounts.php Providers.php ProvidersAccounts.php
I made the relationships and everything is working fine, but how can i get for example all the accounts paired with provider. Currently I can take the records separately like this
$providers = Providers::findFirst();
$providersAccounts = $providers->accounts->toArray();
I am getting only the account paired with the provider. So my question is how can i get multidimensional array together with the paired accounts. Thanks in advance