Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Visitor Laravel Package

shetabit/visitor

Track and log Laravel visitor info (IP, browser, device, platform, languages, user agent) via request helper, and attach visit logs to models with a Visitable trait. Includes online user detection and visit counting/uniques by IP or user.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Analytics & Personalization Roadmap:

    • Enable visitor segmentation (e.g., mobile vs. desktop users) for A/B testing or dynamic content delivery.
    • Power recommendation engines (e.g., "Users like you also viewed...") by tracking model visits (e.g., products, articles).
    • Support heatmaps or popularity rankings (e.g., "Top 10 viewed products this week") via visit log queries.
  • Monetization Features:

    • Dynamic pricing: Adjust prices based on visitor location (via GeoIP) or device type.
    • Targeted ads: Serve ads to high-intent visitors (e.g., users who viewed a product but didn’t add it to cart).
    • Subscription triggers: Offer discounts to users who visit key pages but haven’t converted.
  • Build vs. Buy Decision:

    • Buy: Avoid reinventing visitor parsing (User-Agent, IP, device detection) and session management. The package handles:
      • Parsing with UAParser (browser/device detection).
      • IP-based deduplication to avoid overcounting.
      • Database schema for visit logs (no need to design tables from scratch).
    • Customize: Extend traits/middleware for niche needs (e.g., integrating with custom auth or CRM data).
    • Avoid: Building a full analytics stack (e.g., PostHog, Mixpanel) if you only need basic visitor metadata + model tracking.
  • Compliance & Privacy:

    • GDPR/CCPA: Built-in controls to:
      • Exclude sensitive routes (e.g., /login, /checkout) from logging.
      • Anonymize or purge logs via migrations.
      • Hash IPs for compliance (optional GeoIP integration).
    • Use Case: Enable "right to be forgotten" by adding a purgeLogs() method to the Visitor facade.
  • Real-Time Collaboration Tools:

    • Live indicators: Show "2 users online" for documents or dashboards (e.g., Notion, Figma).
    • Presence systems: Replace WebSocket-heavy solutions for low-latency needs (e.g., "User X is typing...").
  • Content & SEO:

    • Trending content: Identify high-engagement pages to optimize SEO or ad placements.
    • Bot filtering: Exclude crawlers (e.g., Googlebot) from visit logs to focus on human traffic.

When to Consider This Package

Adopt This Package If:

  • You’re building a Laravel-based product (5.5+) and need server-side visitor tracking without client-side dependencies.
  • Your use cases align with:
    • Model-specific visit tracking (e.g., blog posts, products, dashboards).
    • Online user detection (e.g., live collaboration, admin dashboards).
    • Basic analytics (IP, browser, device) for personalization or compliance.
  • You prioritize developer efficiency and can customize traits/middleware for edge cases.
  • Your compliance needs are GDPR/CCPA-focused (not HIPAA or other regulated data).
  • You’re targeting moderate-scale traffic (not 10M+ daily visitors where this could bottleneck).

Look Elsewhere If:

  • You need sub-100ms latency for high-frequency tracking (consider a dedicated analytics service).
  • Your analytics go beyond visitor metadata (e.g., session replay, heatmaps → use Hotjar/PostHog).
  • You’re not using Laravel or need multi-language support.
  • You require advanced geolocation (beyond the package’s optional GeoIP) or offline analytics.
  • Your product is mobile-first with heavy client-side logic (e.g., PWAs, offline apps).
  • You need end-to-end encryption for visitor logs (e.g., HIPAA compliance).

How to Pitch It (Stakeholders)

For Executives:

"This package lets us ship real-time user engagement features—like ‘X users are viewing this’—without heavy engineering. For example:

  • SaaS: Show active users in admin dashboards to prioritize support.
  • E-commerce: Trigger discounts for users who view products but don’t convert.
  • Media: Identify trending content to optimize ad placements. It’s a drop-in solution that replaces custom tracking, saving dev time while enabling data-driven decisions. Compliance controls (GDPR/CCPA) are built in, and it integrates natively with Laravel—no third-party dependencies."

ROI:

  • Time Saved: Cuts visitor-tracking dev time by >60%.
  • Revenue Upside: Enables features like dynamic pricing or targeted ads.
  • Risk Mitigation: Built-in compliance controls avoid costly audits.

For Engineering:

"This is a production-ready Laravel package for visitor metadata (IP, browser, device) and model tracking. Here’s the implementation plan:

  1. Core Setup:
    • Install via Composer, publish migrations, and add the LogVisits middleware to auto-track visits for models with the Visitable trait.
    • Example: Track views on Post models with $post->visitLogs()->count().
  2. Real-Time Features:
    • Detect online users with visitor()->onlineVisitors(User::class) for live collaboration tools.
    • Extend the Visitor facade to add custom methods (e.g., purgeLogs() for compliance).
  3. Analytics:
    • Query visit logs to build features like "Most viewed products" or "User behavior trends."
    • Use GeoIP (optional) for location-based personalization.
  4. Customization:
    • Override traits (e.g., Visitable) to add custom visit attributes (e.g., CRM data).
    • Exclude sensitive routes from logging via middleware configuration.

Why This Over a Custom Build?

  • Parsing: Handles User-Agent, IP, and device detection out of the box.
  • Schema: Includes migrations for visit logs (no need to design tables).
  • Compliance: Built-in GDPR/CCPA controls (e.g., route exclusion, IP hashing).
  • Performance: Lightweight and optimized for Laravel’s ecosystem.

Next Steps:

  • Spike: Test with a high-traffic route to validate performance (aim for <50ms latency).
  • Compliance: Work with Legal to define log retention/purging policies.
  • Integration: Align with existing auth systems (e.g., pass user IDs to setVisitor())."
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament