diff --git a/src/Events/PostProcessApiEvent.php b/src/Events/PostProcessApiEvent.php index f7b29a81..a425b2d0 100644 --- a/src/Events/PostProcessApiEvent.php +++ b/src/Events/PostProcessApiEvent.php @@ -24,7 +24,7 @@ public function __construct($path, $request, &$response, $resource = null) { $this->request = $request; $this->response = $response; - $name = strtolower($path . '.' . $request->getMethod()) . '.post_process'; + $name = strtolower($path . '.' . str_replace('/', '.', $resource) . '.' . $request->getMethod()) . '.post_process'; parent::__construct($name, $resource); } diff --git a/src/Events/PreProcessApiEvent.php b/src/Events/PreProcessApiEvent.php index 9db6933c..a16339bd 100644 --- a/src/Events/PreProcessApiEvent.php +++ b/src/Events/PreProcessApiEvent.php @@ -22,7 +22,7 @@ public function __construct($path, &$request, &$response, $resource = null) { $this->request = $request; $this->response = $response; - $name = strtolower($path . '.' . $request->getMethod()) . '.pre_process'; + $name = strtolower($path . '.' . str_replace('/', '.', $resource) . '.' . $request->getMethod()) . '.pre_process'; parent::__construct($name, $resource); } diff --git a/src/Events/QueuedApiEvent.php b/src/Events/QueuedApiEvent.php index 19d3a29d..206c2540 100644 --- a/src/Events/QueuedApiEvent.php +++ b/src/Events/QueuedApiEvent.php @@ -26,7 +26,7 @@ class QueuedApiEvent extends ApiEvent */ public function __construct($path, $request, $response, $resource = null) { - $name = strtolower($path . '.' . $request->getMethod()) . '.queued'; + $name = strtolower($path . '.' . str_replace('/', '.', $resource) . '.' . $request->getMethod()) . '.queued'; parent::__construct($name); if ($response instanceof RedirectResponse || $response instanceof StreamedResponse) {