Closed loveshiun closed 3 months ago
Hi @loveshiun,
$relationship = "names"; // or "simpleNames", "hasRecursiveRelationshipsNames", ...
Some relations seem to be working correctly, while others have errors.
Which relationships are working and which aren't?
simpleNames()
:
using hasMany()
no Exception
hasRecursiveRelationshipsNames()
:
hasMany()
, the relation uses other trait, like: HasRecursiveRelationships
Exception
BadMethodCallException Call to undefined method Staudenmeir\LaravelAdjacencyList\Eloquent\Builder::groupLimit().
names()
:
uses morphMany()
, but package https://packagist.org/packages/genealabs/laravel-model-caching is used. I included this in the test, because many models of my current project uses it. I deem it as a built-in feature or a candidate when I need to select one from multiple packages.
Exception
BadMethodCallException Call to undefined method GeneaLabs\LaravelModelCaching\CachedBuilder::groupLimit().
If I do not include the model caching package, it causes other errors:
BadMethodCallException Call to undefined method Illuminate\Database\Eloquent\Builder::groupLimit().
The related models also need to use the HasEagerLimit
trait. In the case of HasRecursiveRelationshipsNames
, replace the HasRecursiveRelationships
trait with HasEagerLimitAndRecursiveRelationships
.
Resolved after using HasEagerLimitAndRecursiveRelationships
in related models.
Thank you.
Error
BadMethodCallException Call to undefined method GeneaLabs\LaravelModelCaching\CachedBuilder::groupLimit().
occurred when using eager limit.packages
Some relations seem to be working correctly, while others have errors.
Is this related to the mentioned Limitations, or is it just not directly compatible with other packages (laravel-model-caching)?