laravel-eloquent-state-machines icon indicating copy to clipboard operation
laravel-eloquent-state-machines copied to clipboard

Supply the transition hooks with more data

Open jezzdk opened this issue 3 years ago • 2 comments

Summary

Currently it's very difficult to pass data to transition hooks. I have this problem when I want to make a transition and the hooks depend on data that was sent in the request. Currently I have to save the request data on the model, even though it's not necessary to save it in the database. This change will allow more data to be sent to transition hooks.

Type of Change

  • [X] :rocket: New Feature
  • [ ] :bug: Bug Fix
  • [ ] :hammer: Refactor
  • [ ] :question: [Other]

jezzdk avatar Dec 21 '21 10:12 jezzdk

I dont think this will ever gets merged since you are replacing the current database migration. Instead there should be a new migration for that.

riyuk avatar Jul 28 '23 14:07 riyuk

Hello @jezzdk .

Let me take a look at this one. Don't like adding extra parameters to the transitionTo method. Let me see if there's another way.

Thanks @riyuk for keeping an eye on this one.

asantibanez avatar Jul 28 '23 15:07 asantibanez