Skip to content

feat: integrate ghdj/laravel-visitor-tracker#40

Merged
GhDj merged 2 commits into
developfrom
feat/visitor-tracker-integration
Apr 28, 2026
Merged

feat: integrate ghdj/laravel-visitor-tracker#40
GhDj merged 2 commits into
developfrom
feat/visitor-tracker-integration

Conversation

@GhDj
Copy link
Copy Markdown
Owner

@GhDj GhDj commented Apr 28, 2026

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.

GhDj added 2 commits April 29, 2026 00:35
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.
@GhDj GhDj merged commit 6262880 into develop Apr 28, 2026
3 checks passed
@GhDj GhDj mentioned this pull request Apr 29, 2026
4 tasks
@GhDj GhDj deleted the feat/visitor-tracker-integration branch April 29, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant