diff --git a/src/Endpoint/Show.php b/src/Endpoint/Show.php index f50b9e3..9f209ca 100644 --- a/src/Endpoint/Show.php +++ b/src/Endpoint/Show.php @@ -38,11 +38,13 @@ class Show public function handle(Context $context): ResponseInterface { + run_callbacks($this->resource->getSchema()->getListeners('showing'), [&$this->model, $context]); + $include = $this->getInclude($context); $this->loadRelationships([$this->model], $include, $context); - run_callbacks($this->resource->getSchema()->getListeners('show'), [&$this->model, $context]); + run_callbacks($this->resource->getSchema()->getListeners('shown'), [&$this->model, $context]); $serializer = new Serializer($this->api, $context); $serializer->add($this->resource, $this->model, $include); diff --git a/src/Schema/Type.php b/src/Schema/Type.php index 3d939f0..8101000 100644 --- a/src/Schema/Type.php +++ b/src/Schema/Type.php @@ -220,7 +220,7 @@ final class Type } /** - * Run a callback when a resource is shown. + * Run a callback after a resource is shown. */ public function onShown(callable $callback): void {