You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Callbacks set on the "base case" definition will be overridden by callbacks added to any groups on the same model, meaning that the first callback won't be called. Since groups definitions build on the "base case" I would expect the callbacks to stack similarly.
This requires duplicating any logic that was in the User callback in all groups.
It would be useful to have a way to "stack" the callbacks, either by modifying setCallback() to add a callback to a list instead of replacing any previous callbacks, or making an new addCallback() method that does that.
The text was updated successfully, but these errors were encountered:
setCallback() replaces previous callbacks making you have to repeat any
logic in the "base case' definition callback if you have a callback on
one of the groups.
See issue thephpleague#472
setCallback() replaces previous callbacks making you have to repeat any
logic in the "base case' definition callback if you have a callback on
one of the groups.
See issue thephpleague#472
setCallback() replaces previous callbacks making you have to repeat any
logic in the "base case' definition callback if you have a callback on
one of the groups.
See issue thephpleague#472
Callbacks set on the "base case" definition will be overridden by callbacks added to any groups on the same model, meaning that the first callback won't be called. Since groups definitions build on the "base case" I would expect the callbacks to stack similarly.
For example:
Then if I create a plain
User
, fieldsemail
will be set andaddress
will be blank, as expected...However if I use the
mygroup:User
factory the first callback isn't called, only the secondThis requires duplicating any logic that was in the
User
callback in all groups.It would be useful to have a way to "stack" the callbacks, either by modifying
setCallback()
to add a callback to a list instead of replacing any previous callbacks, or making an newaddCallback()
method that does that.The text was updated successfully, but these errors were encountered: