{"id":15190111,"url":"https://github.com/candasm/lafres","last_synced_at":"2026-01-30T20:31:59.651Z","repository":{"id":62499352,"uuid":"103706714","full_name":"candasm/lafres","owner":"candasm","description":"Laravel 5 Form Request Sanitizer","archived":false,"fork":false,"pushed_at":"2017-09-16T16:03:56.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-16T01:42:17.112Z","etag":null,"topics":["laravel-request","laravel5","laravel5-package","sanitization","sanitizer"],"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/candasm.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":"2017-09-15T22:30:44.000Z","updated_at":"2020-10-22T15:35:15.000Z","dependencies_parsed_at":"2022-11-02T12:01:25.027Z","dependency_job_id":null,"html_url":"https://github.com/candasm/lafres","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/candasm/lafres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candasm%2Flafres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candasm%2Flafres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candasm%2Flafres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candasm%2Flafres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/candasm","download_url":"https://codeload.github.com/candasm/lafres/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candasm%2Flafres/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28918451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T20:25:28.696Z","status":"ssl_error","status_checked_at":"2026-01-30T20:25:13.426Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["laravel-request","laravel5","laravel5-package","sanitization","sanitizer"],"created_at":"2024-09-27T20:04:36.270Z","updated_at":"2026-01-30T20:31:59.622Z","avatar_url":"https://github.com/candasm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lafres(Laravel 5 Form Request Sanitizer)\n\n\n#### Why I create this package?\nSanitizer support does not exists anymore on laravel framework. Actually which is not necessary when there is a validation for form inputs.\nBut when you want a simple functionality for form filtering ups! There is nothing to do rather then write a few lines.\n\n#### What it does?\nRemoves form keys which are not returning from rules method.  \n\n#### Install\n\n```\n$ composer require candasm/laravel-form-request-sanitizer\n```\n\n#### How to use it?\n\nJust use `SanitizeWhenResolvedTrait` in your application abstract Request class. \n\n```php\n\u003c?php \n\nnamespace App\\Http\\Requests;\n\nuse Illuminate\\Foundation\\Http\\FormRequest;\nuse Candasm\\Lafres\\SanitizeWhenResolvedTrait;\n\nabstract class Request extends FormRequest {\n\tuse SanitizeWhenResolvedTrait;\n\t\n\t//\n}\n\n```\n\nAnd use `SanitizeFormRequest` interface in your FormRequest(exp: `StoreBlogPostRequest`) class.\n```php\n\u003c?php\n\nnamespace App\\Http\\Requests;\n\nuse App\\Http\\Requests\\Request;\nuse Candasm\\Lafres\\SanitizeFormRequest;\n\nclass StoreBlogPostRequest extends Request implements SanitizeFormRequest\n{\n\n    /**\n     * Get the validation rules that apply to the request.\n     *\n     * @return array\n     */\n    public function rules()\n    {\n        return [\n            'title' =\u003e 'required|unique:posts|max:255',\n            'body' =\u003e 'required',\n        ];\n    }\n}\n```\nFor this case if you will receive post request like this:\n```\n\t[\n            'title' =\u003e 'test',\n            'body' =\u003e 'test',\n            'subject' =\u003e 'test',\t    \n        ]\n```\nAnd you wanna get all request parameters from `$request` variable(which is injecting to your controller method).\n```php\n...\n\tpublic function store(StoreBlogPostRequest $request)\n\t{\n\t\t$attributes = $request-\u003eall();\n\t\t$blogPost = BlogPost::create($attributes);\n\t}\n...\n```\nBlogPost model will receive only those parameters:\n```\n\t[\n            'title' =\u003e 'test',\n            'body' =\u003e 'test',    \n        ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandasm%2Flafres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcandasm%2Flafres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandasm%2Flafres/lists"}