xetaio/xetaravel-counts
A Laravel package for adding countable relationships to Eloquent models. Track views, likes, or any custom counts on your records using simple traits and polymorphic relations, with helpers for incrementing, decrementing, and querying totals.
Package: xetaio/xetaravel-counts — Laravel/Eloquent trait that attaches polymorphic, date-scoped counters (daily/monthly/yearly) to any model via a shared counts morph table.
Architecture fit
Integration feasibility
composer require, publish and run the migration, add the trait, adopt the count helper methods. Expect under a day of engineering plus a backfill script if existing counters must be migrated.Technical risk
illuminate/* constraint and drops older framework support. If our platform is not on Laravel 13, 3.0.0 is simply not installable, and the upgrade becomes a framework project, not a package upgrade.Key questions
^13.0 only? What is the minimum PHP version?increment), and is it wrapped in a transaction?Stack fit
Migration path
php artisan migrate; treat any column or index change as a data-migration task with a rollback plan.^2.0 and stay there. Do not attempt to force-install 3.0.0 with --ignore-platform-reqs; a compatibility shim for a package this small is more expensive than the framework upgrade it is signalling.Compatibility
composer update.Sequencing
Maintenance
Support
Scaling
O(entities × periods) — unbounded over time unless the table is pruned or partitioned. Plan a retention job for daily rows and an index on (countable_type, countable_id, date).Failure modes
Ramp-up
Assessment basis: release 3.0.0 (framework compatibility bump to Laravel 13 only). All statements about constraint tightening, schema changes, and API stability are inferred from semver and should be confirmed against the package's composer.json and migration diff before committing to a path.
How can I help you explore Laravel packages today?