Skip to content

Get possible states for a given state #25

Open
@aeq-dev

Description

@aeq-dev

Summary

What's the new feature about? What should it do?

return [
        'pending' => ['approved', 'declined'],
        'approved' => ['processed'],
    ];

I need to know which states are allowed to be executed for a given state,
Something like this:
array = $model->status->allowedStatesToBeAppliedOn('approved'); // => this gives ['processed']

Additional Notes

This may be usefull for UI/UX, when we view a model record, we may show a button actions to perform one of its allowed states to be applied.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions