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
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@ provider which results in every model in your application with a observer is "bo
12
12
package aims to reduce that overhead by connecting listeners just-in-time whenever the Eloquent model is booted (first used) in the request. The event callbacks are also
13
13
defined on the model itself keeping the code cleaner, althought this is my preference of course and if you disagree this might not be the package for you.
14
14
15
+
> [!NOTE]
16
+
> Laravel 10.44 [introduced](https://laravel-news.com/laravel-10-44-0#content-new-observedby-attribute-for-models) the `ObservedBy` attribute which allows you to define the observer on the model itself which negates all the performance benefits of this package.
17
+
> However this package still provides an alternative way to define the event handler methods on the model itself so might still be considered useful but using the `ObservedBy` attribute will solve the performance issue with registering the model observers inside a service provider.
0 commit comments