From 3a3e883216d7b81e41be055c5c09447b2b81184f Mon Sep 17 00:00:00 2001 From: Erik Sanders Date: Tue, 12 Mar 2019 14:34:15 +0100 Subject: [PATCH] Laravel 5.8 fix - In Laravel 5.4 the fire method for events was renamed to dispatch. The fire method has been an alias to dispatch until 5.8. --- src/Cloner.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cloner.php b/src/Cloner.php index 8284fec..6f57388 100644 --- a/src/Cloner.php +++ b/src/Cloner.php @@ -110,7 +110,7 @@ protected function saveClone($clone, $relation = null, $src, $child = null) { // Notify listeners via callback or event if (method_exists($clone, 'onCloning')) $clone->onCloning($src, $child); - $this->events->fire('cloner::cloning: '.get_class($src), [$clone, $src]); + $this->events->dispatch('cloner::cloning: '.get_class($src), [$clone, $src]); // Do the save if ($relation) $relation->save($clone); @@ -118,7 +118,7 @@ protected function saveClone($clone, $relation = null, $src, $child = null) { // Notify listeners via callback or event if (method_exists($clone, 'onCloned')) $clone->onCloned($src); - $this->events->fire('cloner::cloned: '.get_class($src), [$clone, $src]); + $this->events->dispatch('cloner::cloned: '.get_class($src), [$clone, $src]); } /**