From f6c8fba11fc452538670843d2d9d6774ba202d88 Mon Sep 17 00:00:00 2001 From: "A. Stewart" Date: Fri, 17 Feb 2023 14:52:12 -0500 Subject: [PATCH] Prevent conflicts between method-local vs. arrow-function variable name --- src/LaravelAttributeObserverServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LaravelAttributeObserverServiceProvider.php b/src/LaravelAttributeObserverServiceProvider.php index 1e7abb7..6241ebb 100644 --- a/src/LaravelAttributeObserverServiceProvider.php +++ b/src/LaravelAttributeObserverServiceProvider.php @@ -156,7 +156,7 @@ private function modelHasAttribute(Model $model, string $attribute): bool private function wasChanged(Model $model, string $event, string $attribute = null): bool { // Pull past-tense/post-mutation events from constants array - $postEvents = array_filter(self::EVENTS, fn ($event) => Str::endsWith($event, 'ed')); + $postEvents = array_filter(self::EVENTS, fn ($e) => Str::endsWith($e, 'ed')); if (in_array($event, $postEvents)) { return $attribute