You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found out that including only one model in the boot method it discovers all other models and their relations. That is a strange behaviour that should be checked.
public function boot(): void
{
Sanctum::usePersonalAccessTokenModel(PersonalAccessToken::class);
// \Lodata::discover(\App\Models\Customer::class);
// \Lodata::discover(\App\Models\ProductType::class);
\Lodata::discover(\App\Models\Status::class); -->> I only want this discovered
dd(\Lodata::getResources()); -->> this prints out all models + relations
}
The text was updated successfully, but these errors were encountered:
Hi @bimix, this will happen if you have a LodataRelationship between two models, Lodata will discover both models in order to create the relationship - is this the case here?
@27pchrisl I don't think that's the case. I tried discovering only a model that has no direct relation with the model I am querying and it returns a response. When I try to log all discovered relations it logs everything (even if only one of them is discovered):
dd(\Lodata::getResources());
I found out that including only one model in the boot method it discovers all other models and their relations. That is a strange behaviour that should be checked.
The text was updated successfully, but these errors were encountered: