From 0a0eef5bdac96d850e3a8e3028c487e17c4b443c Mon Sep 17 00:00:00 2001 From: Zep Fietje Date: Wed, 2 Aug 2023 19:45:00 +0200 Subject: [PATCH] Use regular middleware --- CHANGELOG.md | 7 +++++++ src/Http/Middleware/TrackPageview.php | 13 ++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2614408..65c79e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [0.4.7] - 2023-08-02 + +### Changed + +- Use regular middleware. + ## [0.4.6] - 2023-04-08 ### Changed @@ -104,6 +110,7 @@ - TrackPageview middleware. +[0.4.7]: https://github.com/pirsch-analytics/laravel-pirsch/releases/tag/0.4.7 [0.4.6]: https://github.com/pirsch-analytics/laravel-pirsch/releases/tag/0.4.6 [0.4.5]: https://github.com/pirsch-analytics/laravel-pirsch/releases/tag/0.4.5 [0.4.4]: https://github.com/pirsch-analytics/laravel-pirsch/releases/tag/0.4.4 diff --git a/src/Http/Middleware/TrackPageview.php b/src/Http/Middleware/TrackPageview.php index 57375b0..1c8f9ac 100644 --- a/src/Http/Middleware/TrackPageview.php +++ b/src/Http/Middleware/TrackPageview.php @@ -11,23 +11,22 @@ class TrackPageview { public function handle(Request $request, Closure $next): mixed { - return $next($request); - } + $response = $next($request); - public function terminate(Request $request, mixed $response): void - { if ($response instanceof RedirectResponse) { - return; + return $response; } if ($request->hasHeader('X-Livewire')) { - return; + return $response; } if (str_starts_with($request->route()->uri, 'telescope/')) { - return; + return $response; } Pirsch::track(); + + return $response; } }