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
Describe the bug
Models that do not implement HasStateMachines, and have a scopeStatus method, will throw a 'call to undefined method status()' exception.
To Reproduce
Steps to reproduce the behavior:
Create ModelA with a scopeStatus method. The method can be a no-op, it doesn't matter.
Create ModelB implementing HasStateMachines.
Try call ModelA::status()->first();
Be sad
Expected behavior
The call to ModelA::status()->first() should not throw a method not found exception.
Solution Ideas
Presume the registering of the status macro in boot of HasStateMachines is causing the issue but not had much of a dig.
Obviously not an issue for new applications making use of this package, but very problematic for existing apps with many models implementing legacy status management, as is the case with our application.
An interim solution for any reader of this Issue is to find/replace all uses of ->status() with something like ->legacyStatus() and change scopeStatus to scopeLegacyStatus.
Love the package BTW. Well done legends!!!
The text was updated successfully, but these errors were encountered:
Hey @CaptainHilly ! Thank you for trying out the package.
Yes! I am aware of the status() issue. I've ran into the same problem myself. I am thinking of adding a prefix/suffix to these helper methods that can be customized via config. Eg: suffix => 'StateMachine', method statusStateMachine()
Describe the bug
Models that do not implement HasStateMachines, and have a scopeStatus method, will throw a 'call to undefined method status()' exception.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The call to ModelA::status()->first() should not throw a method not found exception.
Solution Ideas
Presume the registering of the status macro in boot of HasStateMachines is causing the issue but not had much of a dig.
Obviously not an issue for new applications making use of this package, but very problematic for existing apps with many models implementing legacy status management, as is the case with our application.
An interim solution for any reader of this Issue is to find/replace all uses of ->status() with something like ->legacyStatus() and change scopeStatus to scopeLegacyStatus.
Love the package BTW. Well done legends!!!
The text was updated successfully, but these errors were encountered: