refactor: use DTO and terminate middleware for better performance

- Add PageviewData readonly DTO class for type safety
- Update AnalyticsClient to accept PageviewData instead of array
- Move analytics sending to terminate() method (runs after response sent)
- Update all tests for new DTO pattern
This commit is contained in:
mathiaspalmqvist committed 2026-01-03 15:09:48 +01:00
1 parent 448ac3e4cf
commit e3911ca12c
6 files changed
+154 -116

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ class TestCase extends Orchestra
public function getEnvironmentSetUp($app)
{
config()->set('mattitja-analytics.site_key', 'test-site-key');
config()->set('mattitja-analytics.site_key', 'testsiteky');
config()->set('mattitja-analytics.enabled', true);
}
}