@@ -32,6 +32,7 @@ Practical examples and common usage patterns.
3232- ** [ Common Scenarios] ( 03-usage/05-common-scenarios.md ) ** - Real-world implementation examples
3333- ** [ Artisan Commands] ( 03-usage/06-artisan-commands.md ) ** - Managing running numbers via CLI
3434- ** [ Events] ( 03-usage/07-events.md ) ** - Listening to generation events for auditing and logging
35+ - ** [ REST API] ( 03-usage/08-rest-api.md ) ** - HTTP endpoints for remote number generation
3536
3637### [ 04. Features] ( 04-features/ )
3738
@@ -105,10 +106,11 @@ Complete upgrade guide for all versions.
105106- ** Eloquent Trait** : Auto-generate numbers on model creation with InteractsWithRunningNumber
106107- ** Artisan Commands** : CLI commands for managing, listing, resetting, and creating running numbers
107108- ** Event System** : Built-in events for auditing, logging, and notifications
109+ - ** REST API** : Optional HTTP endpoints for remote number generation and management
108110- ** Highly Configurable** : Customize padding, formatting, and behavior
109111- ** Extensible Architecture** : Custom generators and presenters via contracts
110- - ** Developer Friendly** : Helper functions, facades, trait, commands, events, and excellent IDE support
111- - ** Comprehensively Tested** : 128 tests, 315 assertions, PHPStan Level 5, 100% type coverage
112+ - ** Developer Friendly** : Helper functions, facades, trait, commands, events, API, and excellent IDE support
113+ - ** Comprehensively Tested** : 143 tests, 413 assertions, PHPStan Level 5, 100% type coverage
112114- ** Laravel 9-12** : Full support for Laravel 9.x, 10.x, 11.x, and 12.x
113115- ** PHP 8.1-8.4** : Supports PHP 8.1, 8.2, 8.3, and 8.4
114116- ** Production Ready** : Battle-tested for high-concurrency enterprise applications
@@ -307,16 +309,41 @@ DB::transaction(function () {
307309// Uses row-level locking and atomic operations internally
308310```
309311
312+ ### Using REST API
313+
314+ ``` bash
315+ # Generate a number via HTTP
316+ curl -X POST http://localhost:8000/api/running-numbers/generate \
317+ -H " Content-Type: application/json" \
318+ -d ' {"type": "invoice", "scope": "retail"}'
319+
320+ # Response:
321+ # {
322+ # "success": true,
323+ # "data": {
324+ # "type": "INVOICE",
325+ # "number": "INVOICE001",
326+ # "scope": "retail"
327+ # }
328+ # }
329+
330+ # Check current number
331+ curl http://localhost:8000/api/running-numbers/current/invoice
332+
333+ # Preview next number
334+ curl http://localhost:8000/api/running-numbers/preview/invoice
335+ ```
336+
310337## 📊 Package Statistics
311338
312- - ** Total Tests** : 128 tests with 315 assertions
339+ - ** Total Tests** : 143 tests with 413 assertions
313340- ** Code Quality** : PHPStan Level 5 with 0 errors
314341- ** Type Coverage** : 100% type hints on all methods
315- - ** Test Coverage** : Comprehensive coverage including edge cases and concurrency tests
342+ - ** Test Coverage** : Comprehensive coverage including edge cases, concurrency, and API tests
316343- ** Laravel Support** : 9.x, 10.x, 11.x, 12.x
317344- ** PHP Support** : 8.1, 8.2, 8.3, 8.4
318- - ** Documentation** : 35 + pages of comprehensive guides with real-world examples
319- - ** New Features** : Eloquent trait, 3 Artisan commands, Event system
345+ - ** Documentation** : 40 + pages of comprehensive guides with real-world examples
346+ - ** New Features** : Eloquent trait, 3 Artisan commands, Event system, REST API
320347
321348## 🆘 Getting Help
322349
0 commit comments