WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@somegooser
Copy link
Contributor

When extending Lunar models, events are fired for both the custom class and the Lunar base class. This can cause issues when you want to override event behavior in your custom model.

This change adds a $skipLunarEventForwarding property that allows developers to specify which events should NOT be forwarded to the Lunar base model.

Usage:

class Product extends LunarProduct
{
protected array $skipLunarEventForwarding = ["created", "updated"];
}

This will fire the event only for the custom class, not for Lunar\Models\Product.

When extending Lunar models, events are fired for both the custom class and the Lunar base class. This can cause issues when you want to override event behavior in your custom model.

This change adds a $skipLunarEventForwarding property that allows developers to specify which events should NOT be forwarded to the Lunar base model.

Usage:

class Product extends LunarProduct
{
    protected array $skipLunarEventForwarding = ["created", "updated"];
}

This will fire the event only for the custom class, not for Lunar\Models\Product.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant