{"id":36996204,"url":"https://github.com/nextgen-tech/laravel-sequence","last_synced_at":"2026-01-13T23:48:33.308Z","repository":{"id":57026094,"uuid":"377180786","full_name":"nextgen-tech/laravel-sequence","owner":"nextgen-tech","description":"Generate sequential numbers with pattern (e.g. for invoice numbers)","archived":false,"fork":false,"pushed_at":"2021-06-23T13:13:41.000Z","size":17,"stargazers_count":4,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-08T10:51:22.232Z","etag":null,"topics":["invoices","laravel","numbers","php","sequence"],"latest_commit_sha":null,"homepage":"http://nextgen-tech.pl/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextgen-tech.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-15T13:54:37.000Z","updated_at":"2024-10-22T07:49:25.000Z","dependencies_parsed_at":"2022-08-23T16:20:32.085Z","dependency_job_id":null,"html_url":"https://github.com/nextgen-tech/laravel-sequence","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nextgen-tech/laravel-sequence","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextgen-tech%2Flaravel-sequence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextgen-tech%2Flaravel-sequence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextgen-tech%2Flaravel-sequence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextgen-tech%2Flaravel-sequence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextgen-tech","download_url":"https://codeload.github.com/nextgen-tech/laravel-sequence/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextgen-tech%2Flaravel-sequence/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["invoices","laravel","numbers","php","sequence"],"created_at":"2026-01-13T23:48:33.227Z","updated_at":"2026-01-13T23:48:33.298Z","avatar_url":"https://github.com/nextgen-tech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Sequence\n\nGenerate sequential numbers with pattern (e.g. for invoice numbers)\n\n## Features\n\n* Easy integration\n* Multiple pattern placeholders\n* Support for three most common reset frequencies\n* Automatically creating new ordinal number based on reset frequency\n\n## Installation\n\n```sh\ncomposer require nextgen-tech/laravel-sequence\n```\n\n## Usage\n\n```php\nuse Carbon\\Carbon;\nuse NGT\\Laravel\\Sequence\\Enums\\ResetFrequency;\nuse NGT\\Laravel\\Sequence\\Models\\SequenceRule;\nuse NGT\\Laravel\\Sequence\\SequenceFactory;\n\n/**\n * Create new sequence rule. It needs to be done only once.\n */\nSequenceRule::create([\n    'type'            =\u003e 'invoice',\n    'pattern'         =\u003e '{number}/COMPANY/{year}',\n    'reset_frequency' =\u003e ResetFrequency::YEARLY,\n]);\n\n/**\n * Make sequence factory via container or DI.\n */\n$factory = app(SequenceFactory::class);\n\n/**\n * Create sequence by passing sequence type and date (e.g. issue date of invoice).\n */\n$sequence = $factory-\u003ecreate(\n    'invoice',\n    Carbon::createFromFormat('Y-m-d', '2021-06-01')\n);\n\n/**\n * Public methods of sequence.\n */\n$ordinal = $sequence-\u003egetOrdinalNumber(); // e.g. 21\n$number  = $sequence-\u003egetNumber();        // e.g. 21/COMPANY/2021\n$pattern = $sequence-\u003egetPattern();       // e.g. {number}/COMPANY/{year}\n\n/**\n * After use of generated number, manual increment of ordinal number is required.\n */\n$sequence-\u003eincrement();\n```\n\n## Reset Frequencies\n\nSequences supports three most commonly used reset frequencies. `\\NGT\\Laravel\\Sequence\\Enums\\ResetFrequency` class should be used when creating new sequence rule.\n\n* `ResetFrequency::YEARLY` - resets ordinal number at the beginning of new year\n* `ResetFrequency::MONTHLY` - resets ordinal number at the beginning of new month\n* `ResetFrequency::DAILY` - resets ordinal number at the beginning of new day\n\n## Pattern Placeholders\n\n| Placeholder     | Description                               | Example |\n| --------------- | ----------------------------------------- | ------- |\n| `{number}`      | generated, ordinal number                 |         |\n| `{day}`         | day of passed date with leading zero      | 05      |\n| `{month}`       | month of passed date with leading zero    | 03      |\n| `{year}`        | full year of passed date                  | 2021    |\n| `{day_short}`   | day of passed date without leading zero   | 5       |\n| `{month_short}` | month of passed date without leading zero | 3       |\n| `{year_short}`  | short year of passed date                 | 21      |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextgen-tech%2Flaravel-sequence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextgen-tech%2Flaravel-sequence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextgen-tech%2Flaravel-sequence/lists"}