{"id":21740746,"url":"https://github.com/jdanek/validator","last_synced_at":"2026-02-13T12:14:58.506Z","repository":{"id":262879355,"uuid":"888628985","full_name":"jDanek/validator","owner":"jDanek","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-18T22:53:06.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T20:51:27.957Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jDanek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-11-14T18:17:00.000Z","updated_at":"2025-02-18T22:53:09.000Z","dependencies_parsed_at":"2024-11-14T19:47:56.361Z","dependency_job_id":"a4b45b87-e134-4dcb-9d1e-f67858ab3d83","html_url":"https://github.com/jDanek/validator","commit_stats":null,"previous_names":["jdanek/validator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jDanek%2Fvalidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jDanek%2Fvalidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jDanek%2Fvalidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jDanek%2Fvalidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jDanek","download_url":"https://codeload.github.com/jDanek/validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248660928,"owners_count":21141369,"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":[],"created_at":"2024-11-26T06:15:08.262Z","updated_at":"2026-02-13T12:14:58.479Z","avatar_url":"https://github.com/jDanek.png","language":"PHP","readme":"*Danek\\Validator* is a very small validation library, with the easiest and most usable API we could possibly create.\n\n## Install\nTo easily include *Danek\\Validator* into your project, install it via [composer](https://getcomposer.org) using the command line:\n\n```bash\ncomposer require danek/validator\n```\n\n## Small usage example\n\n```php\nuse Danek\\Validator\\Validator;\n\n$v = new Validator;\n\n$v-\u003erequired('user.first_name')-\u003elengthBetween(2, 50)-\u003ealpha();\n$v-\u003erequired('user.last_name')-\u003elengthBetween(2, 50)-\u003ealpha();\n$v-\u003erequired('newsletter')-\u003ebool();\n\n$result = $v-\u003evalidate([\n    'user' =\u003e [\n        'first_name' =\u003e 'John',\n        'last_name' =\u003e 'D',\n    ],\n    'newsletter' =\u003e true,\n]);\n\n$result-\u003eisValid(); // bool(false).\n$result-\u003egetMessages();\n/**\n * array(1) {\n *     [\"user.last_name\"]=\u003e array(1) {\n *         [\"Length::TOO_SHORT\"]=\u003e string(53) \"last_name is too short and must be 2 characters long.\"\n *     }\n * }\n */\n```\n\n## Functional features\n\n* Validate an array of data\n* Get an array of error messages\n* Overwrite the default error messages on rules, or error messages on specific values\n* Get the validated values of an array\n* Validate different contexts (insert, update, etc.) inheriting validations of the default context\n* Ability to extend the validator to add your own custom rules\n\n## Non functional features\n\n* Easy to write (IDE auto-completion for easy development)\n* Easy to read (improves peer review)\n* Ability to separate controller and view logic\n* Zero dependencies","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdanek%2Fvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdanek%2Fvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdanek%2Fvalidator/lists"}