Weave 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 that summarizes database changes over time. Define a stats class, call increase() or decrease() as events happen, then query totals grouped by day, week, or month, returning increments, decrements, and net differences for each period.

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.0

What's Changed

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

New Contributors

Full Changelog: https://github.com/spatie/laravel-stats/compare/1.0.1...2.0.0

1.0.1
  • Add support for Laravel 9
1.0.0
  • initial release
0.0.1
  • experimental release
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.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle