sertxudeveloper/laravel-counters
Larablocks Analysis
sertxudeveloper/laravel-counters works with Laravel 11, 12 and 13 (latest release v2.0.0, Apr 27, 2026).
Laravel 10 in earlier releases.
Recommendation checks
PromisingPromising: maintained and up to date, meets 2 of 4 checks; not yet widely used.
- Works with Laravel 13, the current version
- Released in the last 12 months (Apr 27, 2026)
- 223 downloads a month (needs 10,000)
- 1 GitHub star (needs 100)
State
Maintained- Last stable release: Apr 27, 2026.
- 1 release in the last 12 months.
- First released: Feb 29, 2024.
- Monthly downloads: 223.
- 1 open issue on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.
| Install | |
|---|---|
composer require sertxudeveloper/laravel-counters |
|
| Latest Version: | v2.0.0 |
| PHP: | ^8.2 || ^8.3 || ^8.4 || ^8.5 |
| Laravel: | 11 · 12 · 13 |
| Older releases: | 10 |
| License: | MIT |
| Last Updated: | Nov 3, 2026 |
| Links: | GitHub · Packagist |

Laravel Counters
Manage counters in your Laravel application.
This package allows you to manage counters in your Laravel application. You can create a counter and increment or decrement it as you need. You can also create a counter with a series or a year, so you can have different counters for different series or years.
Requirements
This package requires Laravel 10.0 or higher.
Installation
You can install the package via composer:
composer require sertxudeveloper/laravel-counters
Usage
First, you should run the migrations:
php artisan migrate
That's it! You are ready to use the package.
Here is an example of how to use the package:
Use a basic counter
use SertxuDeveloper\Counters\Counter;
$counter = Counter::make('INVOICES');
$invoice->number = $counter->next(); // 1
Use a counter with a series
use SertxuDeveloper\Counters\Counter;
$counter = Counter::make('INVOICES', series: 'N');
$invoice->number = $counter->next(); // 1
$invoice->number = $counter->next(); // 2
$counter = Counter::make('INVOICES', series: 'R');
$invoice->number = $counter->next(); // 1
Use a counter with a year
use SertxuDeveloper\Counters\Counter;
$counter = Counter::make('INVOICES', year: 2023);
$invoice->number = $counter->next(); // 1
$invoice->number = $counter->next(); // 2
$counter = Counter::make('INVOICES', year: 2024);
$invoice->number = $counter->next(); // 1
Use a counter with a year and a series
use SertxuDeveloper\Counters\Counter;
$counter = Counter::make('INVOICES', year: 2023, series: 'N');
$invoice->number = $counter->next(); // 1
$invoice->number = $counter->next(); // 2
$counter = Counter::make('INVOICES', year: 2023, series: 'R');
$invoice->number = $counter->next(); // 1
$counter = Counter::make('INVOICES', year: 2024, series: 'N');
$invoice->number = $counter->next(); // 1
Decrement a counter
use SertxuDeveloper\Counters\Counter;
$counter = Counter::make('INVOICES');
$invoice->number = $counter->next(); // 1
$invoice->number = $counter->next(); // 2
$invoice->number = $counter->decrement(); // 1
Custom increment
use SertxuDeveloper\Counters\Counter;
$counter = Counter::make('INVOICES');
$invoice->number = $counter->next(); // 1
$invoice->number = $counter->increment(5); // 6
Custom decrement
use SertxuDeveloper\Counters\Counter;
$counter = Counter::make('INVOICES');
$invoice->number = $counter->next(); // 1
$invoice->number = $counter->increment(5); // 6
$invoice->number = $counter->decrement(3); // 3
Testing
This package contains tests, you can run them using the following command:
composer test
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
Copyright © 2024 Sertxu Developer
Related Packages
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v2.0.0 | ^8.2 || | ^11.0 || | MIT | |
| 1.3.0 | ^8.1| | ^10.0| | MIT | |
| v1.2.0 | ^8.1| | ^10.0| | MIT | |
| v1.1.1 | ^8.1| | ^10.0| | MIT | |
| v1.1.0 | ^8.1| | ^10.0| | MIT | |
| v1.0.1 | ^8.2 | ^10.0 | MIT | |
| v1.0.0 | ^8.2 | ^10.0 | MIT |