Skip to content

Commit 290327b

Browse files
committed
docs: Update README to include REST API features and usage examples
1 parent 3d0be34 commit 290327b

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ Generate sequential running numbers for your Laravel application. Perfect for in
2424
- 🆔 **UUID Support** - Built-in UUID support for running number records
2525
- 🏷️ **Native PHP Enums** - Modern PHP 8.1+ enum support with Traitify
2626
- 🔧 **Extensible** - Custom generators and presenters via contracts
27-
- 🚀 **Developer Friendly** - Helper functions, facades, Eloquent trait, and Artisan commands
27+
- 🚀 **Developer Friendly** - Helper functions, facades, Eloquent trait, Artisan commands, and REST API
2828
- 🎭 **Event System** - Built-in events for auditing and notifications
29+
- 🌐 **REST API** - Optional HTTP endpoints for remote number generation
2930
- 📦 **Wide Compatibility** - Laravel 9-12 & PHP 8.1-8.4
3031

3132
## 📦 Installation

docs/03-usage/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Learn how to use Laravel Running Number in your Laravel application with practic
1111
5. [Common Scenarios](05-common-scenarios.md) - Real-world usage examples
1212
6. [Artisan Commands](06-artisan-commands.md) - Managing running numbers via CLI
1313
7. [Events](07-events.md) - Listening to running number generation events
14+
8. [REST API](08-rest-api.md) - HTTP endpoints for remote number generation
1415

1516
## Quick Examples
1617

docs/README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)