Samuel Levy
Samuel Levy
> Apologies if I missed a mitigation for this in your implementation but I felt like mentioning this couldn't hurt. I haven't done any mitigation for it yet, but I...
> Why is it called "inverse" instead of something more sensible like `->linksTo()` or `->references()`? Just throwing some ideas out here. Essentially it's marking the reverse/inverse _relationship_, not just a...
> Wouldn't this causes an infinite loop in `$model->toArray()`? Potentially, yes. Well... no, this wouldn't _cause_ it - the potential already exists when you use `setRelation()`, or with multiple other...
I've pushed up changes to make `->inverse()` guess the relation based on a number of clues, including the foreign key, the name of the parent model, the morph type (if...
> I disagree; the word "inverse" in the docs is used as an indication that `hasMany` has an inverse, being `belongsTo`. It gives me the impression that I get a...
@driesvints it had been ready to go for a while, except for a concern about `relationsToArray()` which I have thoughts about, but isn't appropriate for this PR. Essentially this would...
@taylorotwell the basic issue is if you have circular references in relationships, then `$model->relationsToArray()` (and by extension `$model->toArray()`) will just keep recursively trying to re-serialise the same objects. A toy...
Found some time, eventually. The recursive/circular relations issue should be resolved/resolvable with #52461
> @samlev Hey, thanks for the feature. What was the reason to keep `chaperon` and `inverse`? That's a question for @taylorotwell - `inverse()` was the name that I used in...
@moisish The problem with `BelongsTo` relationships is that the inverse relation is usually a `HasMany`, and in that case there's not a good story because you have a single model...