Skip to content

Commit

Permalink
Laravel 5.8 fix
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
eriksanders86 committed Mar 12, 2019
1 parent fcfc302 commit 3a3e883
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Cloner.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ 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);
else $clone->save();

// 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]);
}

/**
Expand Down

0 comments on commit 3a3e883

Please sign in to comment.