{"id":16805437,"url":"https://github.com/sifex/sla-timer","last_synced_at":"2025-03-15T13:31:10.095Z","repository":{"id":45761602,"uuid":"514423937","full_name":"sifex/sla-timer","owner":"sifex","description":"A PHP package for calculating \u0026 tracking the Service Level Agreement completion timings","archived":false,"fork":false,"pushed_at":"2025-01-21T20:57:56.000Z","size":2126,"stargazers_count":33,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T14:06:01.693Z","etag":null,"topics":["hacktoberfest","php","php8","sla","timer"],"latest_commit_sha":null,"homepage":"https://sifex.github.io/sla-timer/","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/sifex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sifex"}},"created_at":"2022-07-15T22:49:38.000Z","updated_at":"2025-01-17T21:34:59.000Z","dependencies_parsed_at":"2024-10-26T21:13:39.996Z","dependency_job_id":"3f060c6c-b518-4887-8ac0-6e28f5452fab","html_url":"https://github.com/sifex/sla-timer","commit_stats":{"total_commits":107,"total_committers":2,"mean_commits":53.5,"dds":0.01869158878504673,"last_synced_commit":"e2b1aaaf6823ac678c14e0bcb0b49f44d9b5551e"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sifex%2Fsla-timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sifex%2Fsla-timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sifex%2Fsla-timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sifex%2Fsla-timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sifex","download_url":"https://codeload.github.com/sifex/sla-timer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243735830,"owners_count":20339536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hacktoberfest","php","php8","sla","timer"],"created_at":"2024-10-13T09:48:13.619Z","updated_at":"2025-03-15T13:31:09.507Z","avatar_url":"https://github.com/sifex.png","language":"PHP","funding_links":["https://github.com/sponsors/sifex"],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/sifex/sla-timer/raw/HEAD/.github/assets/logo.svg?\" width=\"50%\" alt=\"Logo for SLA Timer\"\u003e\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/sifex/sla-timer.svg?style=flat\u0026labelColor=2c353c)](https://packagist.org/packages/sifex/sla-timer)\n[![Total Downloads](https://img.shields.io/packagist/dt/sifex/sla-timer.svg?style=flat\u0026labelColor=2c353c)](https://packagist.org/packages/sifex/sla-timer)\n![GitHub Actions](https://github.com/sifex/sla-timer/actions/workflows/main.yml/badge.svg)\n\nA PHP package for calculating \u0026 tracking the Service Level Agreement completion timings.\n\n### Features\n\n- 🕚 Easy schedule building\n- ‼️ Defined breaches\n- 🏝 Holiday \u0026 Paused Durations\n\n---\n\n\n\u003ca href=\"https://twitter.com/sifex/status/1548374115815346178\"\u003e\n\u003cimg src=\"https://github.com/sifex/sla-timer/raw/HEAD/.github/assets/hiring.svg?\" alt=\"Hi, I'm Alex \u0026 I'm currently looking for a Laravel job. Please reach out to me via twitter, or click this link.\" height=\"49\"\u003e\n\u003c/a\u003e\n\n\n---\n## Installation\n\nYou can install the `sla-timer` via composer:\n\n```bash\ncomposer require sifex/sla-timer\n```\n\n## Getting Started\n\nThe best place to get started with SLA timer is to head over to the [✨ SLA Timer Getting Started Documentation](https://sifex.github.io/sla-timer/guide/getting_started). \n\n## Example Usage\n\nTo create a new SLA Timer, we can start by defining our SLA Schedule:\n\n```php\nrequire 'vendor/autoload.php';\n\nuse Sifex\\SlaTimer\\SLA;\nuse Sifex\\SlaTimer\\SLABreach;\nuse Sifex\\SlaTimer\\SLASchedule;\n\n/**\n * Create a new SLA between 9am and 5:30pm weekdays\n */\n$sla = SLA::fromSchedule(\n    SLASchedule::create()-\u003efrom('09:00:00')-\u003eto('17:30:00')\n        -\u003eonWeekdays()\n);\n```\n\nWe can define out breaches by calling the `addBreaches` method on our SLA\n\n```php\n/**\n * Define two breaches, one at 24 hours, and the next at 100 hours\n */\n$sla-\u003eaddBreaches([\n    new SLABreach('First Response', '24h'),\n    new SLABreach('Resolution', '100h'),\n]);\n```\n\nNow that our **SLA Schedule** and **SLA Breaches** are defined, all we have to do is give our _subject_ \"creation time\" – or our SLA start time – to either the `status` method, or the `duration` method.\n\n```php\n// Given the time now is 14:00:00 29-07-2022\n$status = $sla-\u003estatus('05:35:40 25-07-2022'); // SLAStatus\n$status-\u003ebreaches; // [SLABreach] [0: { First Response } ]\n\n$duration = $sla-\u003eduration('05:35:40 25-07-2022'); // CarbonInterval\n$duration-\u003eforHumans(); // 1 day 15 hours\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Credits\n\n-   [Alex](https://github.com/sifex)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsifex%2Fsla-timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsifex%2Fsla-timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsifex%2Fsla-timer/lists"}