{"id":16066092,"url":"https://github.com/lakshmaji/validators","last_synced_at":"2026-05-02T19:32:21.435Z","repository":{"id":57010819,"uuid":"119277570","full_name":"lakshmaji/validators","owner":"lakshmaji","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-08T11:17:23.000Z","size":1194,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-10T16:43:03.013Z","etag":null,"topics":["laravel","validator","validators"],"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/lakshmaji.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}},"created_at":"2018-01-28T16:45:07.000Z","updated_at":"2018-06-03T13:11:22.000Z","dependencies_parsed_at":"2022-08-21T13:40:44.963Z","dependency_job_id":null,"html_url":"https://github.com/lakshmaji/validators","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lakshmaji/validators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lakshmaji%2Fvalidators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lakshmaji%2Fvalidators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lakshmaji%2Fvalidators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lakshmaji%2Fvalidators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lakshmaji","download_url":"https://codeload.github.com/lakshmaji/validators/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lakshmaji%2Fvalidators/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32547645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"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","validator","validators"],"created_at":"2024-10-09T05:22:51.384Z","updated_at":"2026-05-02T19:32:21.411Z","avatar_url":"https://github.com/lakshmaji.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Validators\n\n\n\n\u003e### What it is\n\n - Validator helpers for Laravel Validation. \n\n\u003e### Version\n\n1.0.1\n\n\u003e### Sample\n\n![Image](https://raw.githubusercontent.com/lakshmaji/validators/master/resources/validator.gif)\n\n\n\u003e### Compatibility\n\n**Laravel version**     | **Validators version**\n-------- | ---\n5.5      | 1.0.1\n5.4 \u003c=   | ? (not sure)\n\n\n\n\u003e### Installation\n\n- This package is available through composer installation\n```bash\n    composer require lakshmaji/validators\n```\n\n- Try updating the application with composer (autloading class namespaces but not mandatory :wink:  )\n```bash\n  composer dump-autoload\n```\n\n\n\u003e### Configurations\n\n- Publish the configuration file.\n```bash\n    php artisan vendor:publish\n```\n- The configuration file will be published to your application **config** directory with the name * validators.php*.\n- Configure the required validator namespaces and validator class paths.\n\n- An example configuration file (validators.php).\n```php\n\u003c?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Validator namespace\n    |--------------------------------------------------------------------------\n    |\n    | The namespace for the validator classes.\n    |\n     */\n    'validator_namespace' =\u003e 'App\\Validators',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Validator path\n    |--------------------------------------------------------------------------\n    |\n    | The path to the validators folder.\n    |\n     */\n    'validator_path' =\u003e 'app' . DIRECTORY_SEPARATOR . 'MyValidators' . DIRECTORY_SEPARATOR . 'MyRules',\n\n];\n\n```\n\n\n\n\u003e### Generating Validator\n\n- Issue the following command in terminal\n```bash\nphp artisan make:validator CreateVehicle\n```\n\n- This will generate the following class and located the path configured in validators.php\n```php\n\u003c?php \n\nnamespace App\\MyValidators\\MyRules;\n\nuse Lakshmaji\\Validators\\Laravel\\LaravelValidator;\nuse Lakshmaji\\Validators\\Contracts\\ValidableInterface;\n\n\n/**\n * Class CreateVehicleValidator\n * @package App\\MyValidators\\MyRules\n */\nclass CreateVehicleValidator extends LaravelValidator implements ValidableInterface\n{\n    /**\n     * @var array\n     */\n    protected $rules = [\n        'name' =\u003e 'required',\n        'model' =\u003e 'required'\n    ];\n\n    /**\n     * @var array\n     */\n    protected $messages = [\n        'model.required' =\u003e 'Please specify the model number',\n    ];\n}\n// end of CreateVehicleValidator class\n```\n\n\n\u003e### Using it in action\n\n```php\n\u003c?php\nnamespace App\\Http\\Controllers\\Cars;\n\nuse App\\MyValidators\\MyRules\\CreateVehicleValidator;\n\n\nprotected $request;\nprotected $validator;\n\npublic function  __construct(Request $request, CreateVehicleValidator $validator) {\n  $this-\u003evalidator = $validator;\n  $this-\u003erequest = $request;\n}\n\npublic function store() {\n  $payload = $this-\u003erequest-\u003eall();\n\n  // validate here\n  if($this-\u003evalidator-\u003ewith($payload)-\u003epasses()) {\n    // validation succedded\n  } else {\n    $errors = $this-\u003evalidator-\u003eformatErrorMessages();\n  }\n}\n\n```\n\n\n\u003e### MISCELLANEOUS\n\n- After installing package you find the **artisan** commands in your project \n  ```bash\nphp artisan list\n  ```\n\n- OR\n```bash\nphp artisan help make:validator\n```\n\n\u003e### Thanks to \n\n[@parthshukla] (https://github.com/parthshukla) \n\n\u003e### LICENSE\n\n[MIT](https://opensource.org/licenses/MIT)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flakshmaji%2Fvalidators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flakshmaji%2Fvalidators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flakshmaji%2Fvalidators/lists"}