{"id":31315545,"url":"https://github.com/webtoolsnz/laravel-json-schema-request","last_synced_at":"2026-02-28T10:35:01.293Z","repository":{"id":57079290,"uuid":"273198399","full_name":"webtoolsnz/laravel-json-schema-request","owner":"webtoolsnz","description":"Laravel's Form Request Validation, but for json-schema documents","archived":false,"fork":false,"pushed_at":"2020-06-18T22:57:16.000Z","size":15,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-25T09:36:35.107Z","etag":null,"topics":["form-request-validation","json-schema","json-schema-validator","laravel"],"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/webtoolsnz.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-06-18T09:35:59.000Z","updated_at":"2024-06-02T23:14:43.000Z","dependencies_parsed_at":"2022-08-24T14:56:25.482Z","dependency_job_id":null,"html_url":"https://github.com/webtoolsnz/laravel-json-schema-request","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/webtoolsnz/laravel-json-schema-request","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webtoolsnz%2Flaravel-json-schema-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webtoolsnz%2Flaravel-json-schema-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webtoolsnz%2Flaravel-json-schema-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webtoolsnz%2Flaravel-json-schema-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webtoolsnz","download_url":"https://codeload.github.com/webtoolsnz/laravel-json-schema-request/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webtoolsnz%2Flaravel-json-schema-request/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29930344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["form-request-validation","json-schema","json-schema-validator","laravel"],"created_at":"2025-09-25T09:31:27.492Z","updated_at":"2026-02-28T10:35:01.268Z","avatar_url":"https://github.com/webtoolsnz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"JSON Schema Request\n================================\n[![CI Action](https://github.com/webtoolsnz/laravel-json-schema-request/workflows/continuous-integration/badge.svg)](https://github.com/webtoolsnz/laravel-json-schema-request/workflows/continuous-integration)\n[![Code Coverage](https://scrutinizer-ci.com/g/webtoolsnz/laravel-json-schema-request/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/webtoolsnz/laravel-json-schema-request/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/webtoolsnz/laravel-json-schema-request/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/webtoolsnz/laravel-json-schema-request/?branch=master)\n\nLaravels [Form Request Validation](https://laravel.com/docs/7.x/validation#form-request-validation) for JSON Schema documents  \n \nInstallation\n--------------\n\n```bash\n composer require webtoolsnz/laravel-json-schema-request\n```\n\nUsage\n------\nThe development experience is identical to Laravel's Form Request Validation, except instead of writing Laravel validation rules, you write a [JSON Schema](https://json-schema.org/). \n\nYou can create a new request using the `make:json-request` command\n\n```bash\nartisan make:json-request MyJsonRequest\n``` \n\nYou will now have new request class `App\\Http\\Requests\\MyJsonRequest`, Below you can see a basic example schema.\n\n```php\n\u003c?php\n\nnamespace App\\Http\\Requests;\n\nuse Webtools\\JsonSchemaRequest\\JsonSchemaRequest;\n\nclass MyJsonRequest extends JsonSchemaRequest\n{\n    public function schema(): array\n    {\n        return [\n            'type' =\u003e 'object',\n            'properties' =\u003e [\n                'first_name' =\u003e ['type' =\u003e 'string'],\n                'last_name' =\u003e ['type' =\u003e 'string'],\n                'email' =\u003e ['type' =\u003e 'string', 'format' =\u003e 'email'],\n            ],\n            'required' =\u003e ['first_name', 'last_name', 'email'],\n            'additionalProperties' =\u003e false,\n        ];\n    }\n}\n```\n\nOnce you have a `JsonSchemaRequest` object, all you need to do is type-hint the request on your controller method. \nThe incoming form request is validated before the controller method is called.\n\n```php\npublic function store(MyJsonRequest $request)\n{\n    // The incoming request is valid...\n\n    // Retrieve the validated input data...\n    $validated = $request-\u003evalidated();\n}\n```\n\nLicense\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%2Fwebtoolsnz%2Flaravel-json-schema-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebtoolsnz%2Flaravel-json-schema-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebtoolsnz%2Flaravel-json-schema-request/lists"}