stream-laravel
stream-laravel copied to clipboard
On update observer
Hello!
So, I want to contribute to this library. From what I understand, this library is not yet auto-update on laravel eloquent model.
So before I want to ask:
- Do you have any reason to not include it?
- What should I looked at before I add this feature? Backward compability? Should I add a custom option to laravel model so for anyone that use this library before would not see any difference and we'll just auto update if they choose to opt-in?
Thank you :)
we always welcome contributions to our libraries! I am not sure what your contribution would be about, can you elaborate a bit more on it?
Sorry for the confusion, it seems I'm not clear about what I'm talking. Let me elaborate.
So currently it seems that this library does not react on auto-update in Eloquent. What I mean is:
- When any of my model "update", the activity on getStream does not get updated. This behaviour is not in my expectation, as what I've thought before that if we do create a new model, we can get the
activityNotifymethod to be fired, as with a model deletion, an activity would be created or deleted on the Stream side.
This feature is important in these cases:
- I want an update-able data relation
- A data relation like
one to manyandmany to many, would be impossible to do. So, in my case I have an invoice feature, that have a relation to several products, that if the Invoice is being paid, I want to notice to all of the product owner that they have product order. In Laravel, the step that we would make is: create the invoice, save the invoice, then save the association between invoices and products. The problem comes because the invoice should be saved first, but before it being saved it has no idea that there would be a relation between the invoice and products included in the invoice, so it can only notify the invoice owner, not the product owner.
Should I note that this would be a breaking change to the current Eloquent model behaviour with getStream (ActivityTrait) :)