{"id":14974524,"url":"https://github.com/bashleigh/laravalidator","last_synced_at":"2026-02-13T20:41:07.166Z","repository":{"id":62501679,"uuid":"95375449","full_name":"bashleigh/LaraValidator","owner":"bashleigh","description":"Laravel validation service provider to allow creation of validation classes","archived":false,"fork":false,"pushed_at":"2017-06-25T19:02:50.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T03:14:53.391Z","etag":null,"topics":["custom","laravel","laravel54","php71","validation"],"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/bashleigh.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":"2017-06-25T17:34:42.000Z","updated_at":"2020-07-08T17:08:00.000Z","dependencies_parsed_at":"2022-11-02T09:46:30.182Z","dependency_job_id":null,"html_url":"https://github.com/bashleigh/LaraValidator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashleigh%2FLaraValidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashleigh%2FLaraValidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashleigh%2FLaraValidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashleigh%2FLaraValidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bashleigh","download_url":"https://codeload.github.com/bashleigh/LaraValidator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240970218,"owners_count":19886526,"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":["custom","laravel","laravel54","php71","validation"],"created_at":"2024-09-24T13:50:41.352Z","updated_at":"2025-10-03T19:32:53.796Z","avatar_url":"https://github.com/bashleigh.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Installation \n\nAdd the service provider to your providers array in `config/app.php`\n\n```php\n'providers' =\u003e [\n    ...\n    ChickenTikkaMasala\\LaraValidator\\ValidatorServiceProvider::class,\n    ...\n ];\n```\n\nNow create a class that extends AbstractValidator in `App\\Validators`;\n\n```php\n\u003c?php\n\nnamespace App\\Validators;\n\nuse \\ChickenTikkaMasala\\LaraValidator\\Validators\\AbstractValidator;\n\nclass CustomValidator extends AbstractValidator\n{\n    public $name = 'custom';\n    \n    public function execute($attribute, $value, array $parameters, $validator) : boolean {\n        return true;\n    }\n    \n    public function message($message, $attribute, $rule, array $parameters) : string {\n        return 'your custom validation failed';\n    }\n}\n\n```\n\nNow use your custom validation like \n\n```php\npublic $rules = [\n    'field' =\u003e 'custom',\n];\n\n```\n\n### Validating parameters \n\nI've added a small exception throwing function that 'validates' the parameters passed.\n\n```php\npublic function execute($attribute, $value, array $parameters, $validator) : boolean {\n    $this-\u003evalidateParameters($parameters, [\n        0 =\u003e 'table name',\n    ]);\n}\n```\n\nNow if we did this with our custom validator \n\n```php\npublic $rules = [\n    'field' =\u003e 'custom',\n];\n\n```\nWe would get an exception \n\n```php\nRequiredParameterException in AbstractValidator.php line 40:\nThe parameter \"table name\" is required.\n```\n\n### Make function \n\nYou can use the `make:validator` command to create a new validator class\n\n```bash\nphp artisan make:validator CustomValidator\n```\n\nAnd that's pretty much it! It's the simple things ;)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashleigh%2Flaravalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbashleigh%2Flaravalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashleigh%2Flaravalidator/lists"}