feat: integrate ghdj/laravel-visitor-tracker#40
Merged
Conversation
Wire the ghdj/laravel-visitor-tracker package (^1.1) into the app to provide first-party visitor analytics for dev-tools.online. Integration: - Require ghdj/laravel-visitor-tracker ^1.1 (composer.json/lock). - Append the package's TrackVisitor middleware to the web group in bootstrap/app.php so all web requests are recorded. - Add the /tools/visitor-tracker route and sitemap entry, served by a new visitorTracker() action on ToolController plus a public-facing Blade view under resources/views/tools/visitor-tracker.blade.php. - Rely on the package's loadMigrationsFrom for the visitors/visits schema; published copies are intentionally not committed. Dashboard auth (env-driven via config/visitor-tracker.php): - Local: token-based auth so the dashboard is gated by a shared secret. - Production: allow_unprotected enabled because the dashboard route is fronted by Cloudflare Access, which performs the actual auth. Operations: - Add cron/migrate.php as the OVH cron entrypoint that bootstraps Laravel and runs migrate --force, so package migrations apply on shared hosting without shell access. - .gitignore: ignore database/*.sqlite, *.sqlite-journal and bootstrap/cache/*.php to keep local artifacts out of the repo. - deploy.yml: strip database/*.sqlite* and bootstrap/cache/*.php from the build before SFTP so dev artifacts never reach production.
The package's service provider throws a RuntimeException during package:discover when the dashboard is enabled but no auth method is configured. CI has no env vars set, so composer install fails before tests can run. Disable the dashboard for the tests job — the suite doesn't exercise it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wire the ghdj/laravel-visitor-tracker package (^1.1) into the app to provide first-party visitor analytics for dev-tools.online.
Integration:
Dashboard auth (env-driven via config/visitor-tracker.php):
Operations: