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

Laravel Stats Laravel Package

spatie/laravel-stats

Lightweight Laravel package to track stat changes in your app over time. Create a stats class, call increase/decrease on events (e.g., subscriptions), then query totals, increments, decrements, and differences grouped by day/week/month for any date range.

View on GitHub
Deep Wiki
Context7
2.1.1
  • Support Laravel 10
  • Support PHP 8.2
2.1.0
2.0.4

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-stats/compare/2.0.3...2.0.4

2.0.2

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-stats/compare/2.0.1...2.0.2

2.0.1
2.0.0

Added

  • Added StatsWriter with classname support (StatsWriter::for(MyModel::class))
  • Added StatsWriter with eloquent-model support (StatsWriter::for($eloquent))
  • Added StatsWriter with "has-many"-relationship support (StatsWriter::for($model->relationship())) - other relationships are untested yet
  • Added StatsWriter with custom-attribute support (StatsWriter::for(MyModel::class, ['custom_column' => 'orders]))
  • Extended StatsQuery with relationship-support (StatsQuery::for($model->relationship()))
  • Extended StatsQuery with additional attributes (StatsQuery::for(StatsEvent::class, ['name' => 'OrderStats']))
  • Extended BaseStats with direct writer access (OrderStats::writer() as addition to OrderStats::query())

Breaking changes

  • Changed visibility of StatsQuery::for($model)->generatePeriods() from public to protected
  • Changed visibility of StatsQuery::getPeriodTimestampFormat() from public to protected
  • Replaced StatsQuery::for($model)->getStatistic() with StatsQuery::for($model)->getAttributes()
  • Removed BaseStats->createEvent()

Migrations

  • Replace StatsQuery::for(OrderStats::class) with OrderStats::query()
  • Replace StatsEvent::TYPE_SET with DataPoint::TYPE_SET
  • Replace StatsEvent::TYPE_CHANGE with DataPoint::TYPE_CHANGE
1.0.1
  • Add support for Laravel 9
1.0.0
  • initial release
What's

Add support for relationships by @christoph-kluge in https://github.com/spatie/laravel-stats/pull/17

See upgrading.md for an upgrading guide.

Added

  • Added StatsWriter with classname support (StatsWriter::for(MyModel::class))
  • Added StatsWriter with eloquent-model support (StatsWriter::for($eloquent))
  • Added StatsWriter with "has-many"-relationship support (StatsWriter::for($model->relationship())) - other relationships are untested yet
  • Added StatsWriter with custom-attribute support (StatsWriter::for(MyModel::class, ['custom_column' => 'orders]))
  • Extended StatsQuery with relationship-support (StatsQuery::for($model->relationship()))
  • Extended StatsQuery with additional attributes (StatsQuery::for(StatsEvent::class, ['name' => 'OrderStats']))
  • Extended BaseStats with direct writer access (OrderStats::writer() as addition to OrderStats::query())

Breaking changes

  • Changed visibility of StatsQuery::for($model)->generatePeriods() from public to protected
  • Changed visibility of StatsQuery::getPeriodTimestampFormat() from public to protected
  • Replaced StatsQuery::for($model)->getStatistic() with StatsQuery::for($model)->getAttributes()
  • Removed BaseStats->createEvent()

Migrations

  • Replace StatsQuery::for(OrderStats::class) with OrderStats::query()
  • Replace StatsEvent::TYPE_SET with DataPoint::TYPE_SET
  • Replace StatsEvent::TYPE_CHANGE with DataPoint::TYPE_CHANGE
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport