Closed Anahkiasen closed 4 years ago
What is the intended behaviour that you're expecting from this?
>>>(new Acme\Entities\Models\User)->roles->count()
=> 1
It should return 0 like it does in Eloquent in my opinion
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Imagine I have an User model that can have multiple roles defined as such:
Now if I get an User model and fetch its roles, all good:
But if I do this on a new model, it will return all existing roles:
Instead of nothing like it does with normal Eloquent, example on another project of mine that does not use neo4j:
I've tripped on this a good bunch of times, mostly when writing upsert logic dealing with models that may or may not exist, some cases causing quite the headache so, thought I'd see if this could maybe be changed to behave like SQL Eloquent does.