{"id":15029182,"url":"https://github.com/koomai/constants","last_synced_at":"2025-10-04T00:30:29.798Z","repository":{"id":57008497,"uuid":"113857749","full_name":"koomai/constants","owner":"koomai","description":"[Deprecated] Validate and retrieve your application-level global constants","archived":true,"fork":false,"pushed_at":"2019-09-06T00:41:12.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T10:51:49.531Z","etag":null,"topics":["composer-package","constants","laravel-package","php","php-packages","php7"],"latest_commit_sha":null,"homepage":"","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/koomai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-11T12:42:31.000Z","updated_at":"2023-01-28T17:19:52.000Z","dependencies_parsed_at":"2022-08-21T12:50:58.502Z","dependency_job_id":null,"html_url":"https://github.com/koomai/constants","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koomai%2Fconstants","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koomai%2Fconstants/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koomai%2Fconstants/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koomai%2Fconstants/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koomai","download_url":"https://codeload.github.com/koomai/constants/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235204448,"owners_count":18952326,"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":["composer-package","constants","laravel-package","php","php-packages","php7"],"created_at":"2024-09-24T20:09:54.438Z","updated_at":"2025-10-04T00:30:24.483Z","avatar_url":"https://github.com/koomai.png","language":"PHP","readme":"# DEPRECATED!\n\nThis package has been deprecated. Check out the following packages:\n\n- https://github.com/myclabs/php-enum\n- https://github.com/BenSampo/laravel-enum\n\n# Constants  \n\nConstants is a helper package for validating and retrieving application-level global constants/enums.\n\n[![Build Status](https://travis-ci.org/koomai/constants.svg?branch=master)](https://travis-ci.org/koomai/constants) \n[![StyleCI](https://styleci.io/repos/113857749/shield?branch=master)](https://styleci.io/repos/113857749)\n\n## Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Changelog](#changelog)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [Credits](#credits)\n- [License](#license)\n\n\n## Installation\n\n`composer require koomai/constants:^1.0`\n\n## Usage\n\n1. Simply extend your class from `Koomai\\Constants\\Constants` and define your constants. E.g.,\n\n```\n\u003c?php\n\nnamespace App\\Constants;\n\nuse Koomai\\Constants\\Constants as AbstractConstants;\n\nclass LeadStatus extends AbstractConstants\n{\n\tconst ATTEMPTED = 'attempted';\n\tconst CONTACTED = 'contacted';\n\tconst OPPORTUNITY = 'opportunity';\n\tconst DISQUALIFIED = 'disqualified';\n}\n\n``` \n\n2. For internal use in your code, you just reference the constant name directly as usual:\n\n`LeadStatus::CONTACTED`\n\n3. When doing look-ups, e.g. via user input or as a parameter in a method, use the static `get()` method:  \n\n`LeadStatus::get($status)`  \n\nIt will return `$status` if it's a valid constant value or throw an `InvalidConstantException`.\n\n4. If you don't want an exception thrown, you can check if the value exists first:\n\n`LeadStatus::has($status)`\n\n5. To retrieve an array of all the constants in a class:  \n\n`LeadStatus::all()`\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Credits\n- [Rohan Deshpande](https://github.com/rohan-deshpande)\n- [laravel-notification-channels/skeleton](https://github.com/laravel-notification-channels/skeleton)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoomai%2Fconstants","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoomai%2Fconstants","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoomai%2Fconstants/lists"}