{"id":22327626,"url":"https://github.com/saip13/laravel-validations","last_synced_at":"2026-04-20T09:33:31.943Z","repository":{"id":110406534,"uuid":"435443296","full_name":"SaiP13/laravel-validations","owner":"SaiP13","description":"Laravel validations","archived":false,"fork":false,"pushed_at":"2022-03-25T12:08:43.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T15:36:22.225Z","etag":null,"topics":["backend-validation","form","formvalidation","laravel","php","validation-errors","validations","validator"],"latest_commit_sha":null,"homepage":"","language":null,"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/SaiP13.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-06T09:56:11.000Z","updated_at":"2021-12-06T10:02:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"90785de5-195d-4655-a469-6a1ca5aa2586","html_url":"https://github.com/SaiP13/laravel-validations","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/SaiP13/laravel-validations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaiP13%2Flaravel-validations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaiP13%2Flaravel-validations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaiP13%2Flaravel-validations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaiP13%2Flaravel-validations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaiP13","download_url":"https://codeload.github.com/SaiP13/laravel-validations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaiP13%2Flaravel-validations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32041471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["backend-validation","form","formvalidation","laravel","php","validation-errors","validations","validator"],"created_at":"2024-12-04T03:09:59.331Z","updated_at":"2026-04-20T09:33:31.935Z","avatar_url":"https://github.com/SaiP13.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravel-validations\n\nuse Illuminate\\Support\\Facades\\Validator;\u003cbr\u003e\nuse Validator;\n\n### # USING ARRAY:\n\n        $validatedData = $request-\u003evalidate([\n            'title' =\u003e ['required', 'unique:posts', 'max:255'],\n            'body' =\u003e ['required'],\n        ]);\n        \n### #Normal | :\n        $validated = $request-\u003evalidate([\n            'title' =\u003e 'required|unique:posts|max:255',\n            'body' =\u003e 'required',\n            'name' =\u003e 'unique:posts',\n            'start_date' =\u003e 'required|date',\n            'email' =\u003e 'email',\n            'size' =\u003e 'max:10|min:3',\n            'title' =\u003e 'size:12', //exactly 12 character long\n            'tags' =\u003e 'array|size:5', //array size 5\n            'image' =\u003e 'file|size:512', //exactly 512 kilobytes\n            'photo' =\u003e 'mimes:jpg,bmp,png', //file types\n            'avatar' =\u003e 'dimensions:min_width=100,min_height=200',\n            'password'=\u003e 'required|confirmed' //match with confirm_password field\n        ]);\n        \n ### # THIS: \n \n      Automatically control returns back if validate errors occurs\n        $this-\u003evalidate($request, [\n            'name' =\u003e 'required|unique:users',\n            'mobile' =\u003e 'required|size:10',\n            'email' =\u003e 'required|email'\n        ]);\n\n### # USING VALIDATOR:\n\n        $validator = Validator::make($request-\u003eall(),[\n            'name' =\u003e 'required',\n            'mobile' =\u003e 'required',\n            'email' =\u003e 'required'\n        ]);\n\n        if($validator-\u003efails()){\n            return response($validator-\u003emessages(), 200);\n            return response($validator-\u003eerrors(), 200);\n        }\n        \n\n### #CUSTOME MESSAGES:\n        $validator = Validator::make($request-\u003eall(), [\n                    'type_id'        =\u003e 'required',\n                    'seller_id'      =\u003e 'required',\n                    'name'      =\u003e 'required',\n                    'product_id'     =\u003e 'required',\n                ],\n                [\n                    'type_id.required'   =\u003e 'This field cant not be blank',\n                    'seller_id.required' =\u003e 'seller ID can not be blank',\n                    'name.required' =\u003e 'Name can not be blank', \n                    'product_id'            =\u003e 'Product ID must be enter'\n                ]);\n### #PRINT ERROR MESSAGES: \n        1) $errors-\u003eall()\n        2) $errors-\u003eget('field_name')\n        3) $errors-\u003efirst('field_name')\n        4) $errors-\u003ehas('email')\n        5) @error('email')\n        6) $message\n\n### #All:\n        @foreach ($errors-\u003eall() as $error)\n            \u003cli\u003e{{ $error }}\u003c/li\u003e\n        @endforeach\n### #Single error: \n            @error('title')\n                \u003cdiv class=\"alert alert-danger\"\u003e{{ $message }}\u003c/div\u003e\n            @enderror\n### #if cond:\n            if ($errors-\u003ehas('email')) {\n                {{ $errors-\u003efirst('email'); || $errors-\u003eget('email') }}\n            }    \n            \n\n\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaip13%2Flaravel-validations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaip13%2Flaravel-validations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaip13%2Flaravel-validations/lists"}