capell-app/site-stats
Site Stats is a Laravel package for the Capell app ecosystem that provides site statistics and analytics, giving developers a simple way to collect and display visitor and usage data within their applications.
composer require capell-app/site-stats. Note the version constraint — this is still pre-1.0 (currently 1.0.0-beta.41), so pin an explicit tag (e.g. "capell-app/site-stats": "1.0.0-beta.41") rather than floating on ^1.0@beta, because the changelog between beta.35 and beta.41 shows six tagged releases with no semver guarantee of API stability.php artisan vendor:publish --tag="site-stats-config" and php artisan vendor:publish --tag="site-stats-migrations". Read the config file in full — it is the single best documentation of what the package actually does (tracking toggles, retention, bot filtering, storage options).php artisan migrate and confirm the stats table(s) exist and are indexed on the columns you intend to query (typically a date/timestamp column plus a URL or route identifier).web group in bootstrap/app.php (Laravel 11+) or app/Http/Kernel.php. If it auto-registers, verify with php artisan route:list -v that it is actually attached to the routes you expect.SELECT * FROM site_stats ORDER BY id DESC LIMIT 5) to confirm a row was written before wiring anything into a dashboard. Once writes are confirmed, add the package's Filament widget(s) to your Capell panel provider and check the numbers render.web group only, and explicitly exclude admin/panel routes, health checks, _ignition, telescope, and any webhook endpoints. A common layout is a dedicated trackable middleware group applied to public route files rather than blanket-applying to web.PanelProvider::panel() via ->widgets([...]), and keep any custom stat widgets in app/Filament/Widgets so they survive package upgrades.Cache::remember() with a short TTL (60–300s) keyed by site + date range, and invalidate on a schedule rather than per-request.phpunit.xml set the package's tracking toggle off (or point it at a null/in-memory store) for feature tests so you don't pollute assertions or the test DB; enable it explicitly only in the tests that assert tracking behavior.beta.35 and beta.41 with no enumerated changelog entries means you should read the compare diff (.../compare/v1.0.0-beta.35...v1.0.0-beta.41) before upgrading, and pin the exact tag in composer.json. Treat every bump as potentially breaking: config keys, table columns, and middleware names can all move pre-1.0.vendor:publish --force on migrations in a shared environment — it overwrites files Laravel has already recorded as run, which desynchronises the migrations table.php artisan config:clear (and config:cache in deploy). A cached config silently ignores your new exclusions, which is the usual cause of "it's tracking the admin panel."StartSession, you get session-based deduplication; if it runs before, you don't. Decide deliberately. Also ensure it runs after any middleware that sets the current site/tenant, or all rows land under the default site.Purpose: prefetch / Sec-Purpose headers, or accept that your numbers are "requests" not "humans" and label the dashboard accordingly.route:list -v), config toggle enabled after a config clear, the route not in an exclusion list, and the DB connection the package resolves (it may use a dedicated connection from config, not your default).How can I help you explore Laravel packages today?