From c5a62901589e313474376e241549ac31d9d3c695 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 27 Feb 2017 08:23:41 -0600 Subject: [PATCH] fix bug with has events --- src/Illuminate/Database/Eloquent/Concerns/HasEvents.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php b/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php index 23bf72be6176..941b58fada56 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php @@ -138,7 +138,11 @@ protected function fireModelEvent($event, $halt = true) $result = $this->fireCustomModelEvent($event, $method); - return ! is_null($result) ? $result : static::$dispatcher->{$method}( + if ($result === false) { + return false; + } + + return ! empty($result) ? $result : static::$dispatcher->{$method}( "eloquent.{$event}: ".static::class, $this ); }