capell-app / referer
Privacy-preserving aggregate referral reporting for Capell sites.
Requires
- php: ^8.4
- capell-app/admin: ^1.0
- capell-app/core: ^1.0
- capell-app/frontend: ^1.0
- lorisleiva/laravel-actions: ^2.8
- spatie/laravel-data: ^4.5
- spatie/laravel-package-tools: ^1.14.1
- spatie/laravel-referer: ^1.9
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-15 06:39:26 UTC
README
What This Plugin Adds
Referers is a Preview Capell package in the Capell Marketing & Growth product group. It is intended to be a free acquisition, but is not yet enabled for stable distribution. It ships as capell-app/referer and extends these surfaces: admin, frontend, console.
Referers adds privacy-preserving aggregate referral reporting to Capell. It keeps daily and lifetime counters for finite source keys without storing raw URLs or request identifiers.
Administrators review site-scoped referral counts in a cached Referrers report and a small dashboard widget, while origin frontend renders record successful HTML responses best-effort.
Evidence: src/Actions/ResolveReferralSourceAction.php, src/Actions/RecordRefererCountAction.php, database/migrations/2026_09_14_000001_create_referer_counts_tables.php, src/Filament/Pages/RefererPage.php, src/Filament/Widgets/TopRefererSourcesFilamentWidget.php, src/Http/Middleware/RecordRefererMiddleware.php.
Status details:
- Status: Preview — not distribution-ready
- Tier: premium; acquisition: free
- Bundle: marketing-growth
- Composer package:
capell-app/referer - Namespace:
Capell\Referer - Theme key: not applicable
Why It Matters
For developers: Typed Actions, bounded validation, atomic upserts, and focused tests keep the privacy contract explicit at each boundary.
For teams: Site teams can see which configured external sources contribute successful page requests without receiving a browsing-event log.
Evidence: src/Actions/BuildRefererReportAction.php, src/Actions/PruneRefererCountsAction.php, tests/Feature/RefererActionsTest.php, docs/admin-guide.md, resources/views/filament/pages/referer.blade.php.
Screens And Workflow
Docs gap: add docs/screenshots.json before promoting this package with visual workflow claims.
- Admin index screen if the package has a Filament resource.
- Create/edit screen if editors create records.
- Settings/configuration screen when settings exist.
- Frontend output when the package renders public pages.
- Package detail or install intent screen when marketplace-owned.
Technical Shape
Service providers
Capell\Referer\Providers\RefererServiceProviderCapell\Referer\Providers\AdminServiceProvider
Config files
packages/referer/config/capell-referer.php
Migrations
packages/referer/database/migrations/2026_09_14_000001_create_referer_counts_tables.php
Models
RefererDailyCountRefererSourceTotal
Filament classes
RefererPageTopRefererSourcesFilamentWidget
Actions
BuildRefererReportActionPruneRefererCountsActionRecordRefererCountActionRefererHealthSignalResolveRefererWindowActionResolveReferralSourceAction
Data objects
RefererReportDataRefererReportRowDataRefererWindowDataReferralSourceData
Command signatures
capell:referer:prune
Scheduled commands
capell:referer:prune (daily; package registered)
Console command classes
PruneRefererCountsCommand
Manifest contributions
admin-page: Capell\Referer\Manifest\RefererAdminPageContributionconsole-command: Capell\Referer\Manifest\RefererConsoleCommandsContributiondashboard-widget: Capell\Referer\Manifest\RefererDashboardFilamentWidgetsContributionhealth-check: Capell\Referer\Manifest\RefererHealthContributionmigration: Capell\Referer\Manifest\RefererMigrationsContributionmodel: Capell\Referer\Manifest\RefererModelsContributionpermission: Capell\Referer\Manifest\RefererPermissionsContributionscheduled-job: Capell\Referer\Manifest\RefererRetentionScheduleContribution
Health checks
Capell\Referer\Health\RefererHealthCheck
Blade views
packages/referer/resources/views/filament/pages/referer.blade.php
Cache tags
referer
Data Model
- Required tables:
referer_daily_counts,referer_source_totals,referer_retention_state. - Models:
RefererDailyCount,RefererSourceTotal. - Core record references in migrations:
sites via site_id. - Migration files:
2026_09_14_000001_create_referer_counts_tables.php. - Migration impact: run host migrations through the package install flow before opening package surfaces.
- Deletion/retention behaviour: migrations declare cascade-on-delete relationships; retention is scheduled through
capell:referer:prune(daily; registered by the package provider).
Install Impact
- Required packages:
capell-app/admin,capell-app/core,capell-app/frontend. - Admin navigation: declares
admin-page: RefererAdminPageContribution; each Filament page or resource controls its own navigation visibility. - Admin/editor extensions:
dashboard-widget: RefererDashboardFilamentWidgetsContribution. - Permissions:
View:RefererPage; Shield-generated page permissions forCapell\Referer\Filament\Pages\RefererPage(names and grants depend on host Shield configuration). - Public routes: none declared.
- Database changes: package migrations are declared.
- Config:
config/capell-referer.php. - Settings: no package settings declared.
- Queues or schedules: scheduled commands
capell:referer:prune (daily; package registered). - Cache tags:
referer. - Commands:
capell:referer:prune.
Common Pitfalls
- Keep required Capell packages on compatible v4 releases:
capell-app/admin,capell-app/core,capell-app/frontend. - Run migrations before opening package resources or public routes.
- Review package configuration before production-like verification:
config/capell-referer.php. - Keep the host Laravel scheduler running so package-registered schedules can execute:
capell:referer:prune (daily; package registered). - Keep public Blade and cached HTML free of authoring markers, model IDs, permissions, signed editor URLs, and lazy database queries.
- Custom write integrations must preserve invalidation for
referercache tags.
Troubleshooting
| Symptom | Likely cause | Check | Fix |
|---|---|---|---|
| Package surface is missing after install | Provider or manifest is not loaded | Confirm capell.json, package composer.json, and provider registration |
Reinstall the package, refresh Composer autoload, and clear host caches |
| Admin screen or command fails on missing table | Package migrations have not run | Check the tables listed in Data Model |
Run host migrations and rerun the focused package test |
| Background work does not run | Queue worker or declared schedule is not active | Check the jobs and scheduled commands listed in Technical Shape |
Start the queue worker or host scheduler, then run the focused command or package test |
| Public output leaks unexpected state | Render data, cache variation, or authoring boundary has regressed | Check public Blade, cache tags, and public-output safety tests | Move data loading out of Blade and rerun the package public-output tests |
Quick Start
- For development evaluation only, install the moving development branch:
composer require capell-app/referer:dev-main. - Do not use this development listing as a stable production dependency. A tagged release remains gated on installed-App/cache-hit integration and the package's release evidence.
Next Steps
- Package docs
- Overview
- Admin guide
- Configuration files:
config/capell-referer.php. - Troubleshooting
- Screenshot contract
- Capell content language plan
- Capell documentation design system
- Capell and package ERD notes
- Focused tests:
vendor/bin/pest packages/referer/tests --configuration=phpunit.xml.