Closed lukeraymonddowning closed 4 years ago
Cool, I'll take a look later (or tomorrow if I dont get chance)
One thought, it would be cool if for the linked models closure it also passed the model it was linked from, in the examples case it would be user and then customer as a second param.
One thought, it would be cool if for the linked models closure it also passed the model it was linked from, in the examples case it would be user and then customer as a second param.
Would this be infinitely deep? So if a user has customers that have books, would afterCreating
in the book relationship receive ($book, $customer, $user)?
That could become a nightmare to track, but cool if possible.
But thinking about the afterCreatingState, if I was using that on a user, and then created some customers in it, then I would have user and customers, but not books (well I would on the eloquent method, depending on the order it was ran in).
And I think, from a sanity point of view that would be the easiest to replicate.
All sorted in the latest commit 👍🥳
🔥 This works perfectly 😀
@AlanHolmes I've been playing with this and think we're finally there. Would you check this out before I merge it in?