{"id":15067155,"url":"https://github.com/nickfla1/laravel-validated-api-requests","last_synced_at":"2025-04-10T13:54:55.372Z","repository":{"id":57026700,"uuid":"191721009","full_name":"nickfla1/laravel-validated-api-requests","owner":"nickfla1","description":"Simple Validation for Laravel's API requests","archived":false,"fork":false,"pushed_at":"2020-06-16T14:00:59.000Z","size":12,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T12:39:34.350Z","etag":null,"topics":["api","composer","composer-library","composer-package","exceptions","json","json-api","laravel","laravel-5-package","laravel-framework","laravel-package","laravel5","php","php7","rest","rest-api","restful","restful-api","validation","validator"],"latest_commit_sha":null,"homepage":null,"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/nickfla1.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":"2019-06-13T08:19:32.000Z","updated_at":"2023-05-13T21:57:19.000Z","dependencies_parsed_at":"2022-08-23T16:11:05.460Z","dependency_job_id":null,"html_url":"https://github.com/nickfla1/laravel-validated-api-requests","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickfla1%2Flaravel-validated-api-requests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickfla1%2Flaravel-validated-api-requests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickfla1%2Flaravel-validated-api-requests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickfla1%2Flaravel-validated-api-requests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickfla1","download_url":"https://codeload.github.com/nickfla1/laravel-validated-api-requests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248229491,"owners_count":21068909,"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":["api","composer","composer-library","composer-package","exceptions","json","json-api","laravel","laravel-5-package","laravel-framework","laravel-package","laravel5","php","php7","rest","rest-api","restful","restful-api","validation","validator"],"created_at":"2024-09-25T01:17:22.260Z","updated_at":"2025-04-10T13:54:55.347Z","avatar_url":"https://github.com/nickfla1.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Laravel Validated API Requests\n\nThis package allows you to use Laravel's validators on API requests.\nThis package is intented to be used only on API requests as the same behaviour can be achieved for regular requests using Laravel's `FormRequest`.\n\n### Installation\n```sh\ncomposer require nickfla1/laravel-validated-api-requests\n```\n**Requirements**\n\n| Library/Ext | Version |\n| --- | --- |\n| php | \u003e=7.0.* |\n| laravel/framework | \u003e=5.5 |\n\n### Basic Usage\n\n**Request**\n```php\nuse Nickfla1\\Utilities\\ApiRequest;\n\nclass FooRequest extends ApiRequest\n{\n    /**\n     * Defines if the request should fire an ApiRequestException\n     * on validation failure.\n     *\n     * @var bool\n     */\n    protected $firesException = true;\n    \n    /**\n     * Define validation rules.\n     *\n     * @return array|null\n     */\n    protected function rules()\n    {\n        return [\n            'foo' =\u003e 'required|string|max:30',\n            'bar' =\u003e 'required|mail'\n        ];\n    }\n}\n```\n\n**Controller**\n```php\nclass TheController extends Controller\n{\n    public function index(FooRequest $request)\n    {\n        // If we get here the request was validated successfully!\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickfla1%2Flaravel-validated-api-requests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickfla1%2Flaravel-validated-api-requests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickfla1%2Flaravel-validated-api-requests/lists"}