capell-app/insights
Insights is a Capell module for Laravel that adds analytics and reporting to your admin panel, giving editors and site owners visibility into content performance and activity through concise dashboards, metrics, and summaries.
composer require capell-app/insights. The service provider is auto-discovered; there is nothing to register manually on a standard Laravel 10/11 app.php artisan vendor:publish --provider="Capell\\Insights\\InsightsServiceProvider"
php artisan migrate
Check the provider's publishes() array for the exact tags — config, migrations and views are usually published separately so you can keep migrations in sync with the package.config/insights.php (tracking toggles, ignored paths, retention), the package's src/Models and src/ database/migrations (what is actually being written per request), and however the package registers its admin/dashboard surface. The migrations tell you more about behaviour than the README does."capell-app/insights": "^1.0" and update freely.composer show capell-app/insights --tree before installing into a plain Laravel app. The package is an official Capell module and may pull in capell core contracts even when you only want the tracking layer.Insights::record() calls in your actions./admin*, /horizon*, /telescope*, /api/*, health checks, asset routes — in config/insights.php so counts reflect real visitors.final class TrafficReport
{
public function daily(string $from, string $to): Collection
{
return InsightsPageView::query()
->whereBetween('created_at', [$from, $to])
->selectRaw('DATE(created_at) as day, COUNT(*) as views')
->groupBy('day')
->orderBy('day')
->get();
}
}
insights_daily summary table you own, and point dashboards at that. Keep the raw table for retention-window drill-downs only.phpunit.xml via the config flag (or by excluding * in the test environment), use RefreshDatabase, and Carbon::setTestNow() when asserting day-bucket boundaries.app()->isProduction() or a config flag, and give every developer a reset command or truncate step in their local seed.Sec-Purpose: prefetch headers, or your numbers will be 2–3× reality.DATE(created_at), "today" in your dashboard is wrong for non-UTC users. Convert to the reporting timezone before bucketing, and be consistent across every query.created_at (and your grouping column) are indexed. Add indexes in your own migration rather than editing a published package migration, so future package migrations still apply cleanly.COUNT(*) in Cache::remember per request just moves the load. Cache the nightly rollup and read that.php artisan migrate after composer update.boot() before assuming it's inert.How can I help you explore Laravel packages today?