Skip to content

New State Machine does not implement a StateChanged event #334

@JustinElst

Description

@JustinElst

Thank for your awesome work.
I was looking into using the latest version but im missing the StateChanged event from the external dependency:

https://spatie.be/docs/laravel-model-states/v2/working-with-transitions/05-transition-events

https://github.com/spatie/laravel-model-states/blob/ce1a41b4fbdf58b28eacd04bb6a758d7057b50de/src/State.php#L197

https://github.com/spatie/laravel-model-states/blob/ce1a41b4fbdf58b28eacd04bb6a758d7057b50de/src/Events/StateChanged.php

Would you be open to have such an event (and maybe other helpful events) in the library?

I was using this event to broadcast the change of state and (hard)set the state in another model.

Originally posted by @JustinElst in #333 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions