{"id":16463148,"url":"https://github.com/mazbaul/comp","last_synced_at":"2026-01-30T12:34:27.632Z","repository":{"id":57016631,"uuid":"239949827","full_name":"Mazbaul/comp","owner":"Mazbaul","description":"A composite key validation package for laravel","archived":false,"fork":false,"pushed_at":"2020-07-27T07:09:45.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T14:22:15.818Z","etag":null,"topics":["composite-key","database","laravel","laravel-package","php","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/Mazbaul.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":"2020-02-12T07:16:15.000Z","updated_at":"2023-03-05T03:26:33.000Z","dependencies_parsed_at":"2022-08-22T09:40:39.934Z","dependency_job_id":null,"html_url":"https://github.com/Mazbaul/comp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mazbaul%2Fcomp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mazbaul%2Fcomp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mazbaul%2Fcomp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mazbaul%2Fcomp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mazbaul","download_url":"https://codeload.github.com/Mazbaul/comp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251465291,"owners_count":21593854,"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":["composite-key","database","laravel","laravel-package","php","validation"],"created_at":"2024-10-11T11:13:30.139Z","updated_at":"2026-01-30T12:34:27.593Z","avatar_url":"https://github.com/Mazbaul.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# composite_unique Validator Rule For Laravel\n\n\nThis package contains composite key validation rule for Laravel, that allows for validation of multi-column UNIQUE indexes.\n\n## Installation\n\nInstall the package through [Composer](http://getcomposer.org).\nOn the command line:\n\n```\ncomposer require mazbaul/comp\n```\n\n## Configuration\n\nAdd the following to your `providers` array in `config/app.php`:\n\n```php\n'providers' =\u003e [\n    // ...\n\n    Mazbaul\\Comp\\CompServiceProvider::class,\n],\n```\n\n## Usage\n\nUse it like any `Validator` rule:\n\n```php\n\n$validator = Validator::make($request-\u003eall(), [\n      \n      \"\u003cfield1\u003e\" =\u003e'required|composite_unique:\u003ctable\u003e,\u003cfield1\u003e,\u003cfield2\u003e',\n    ]);\n```\n\nSee the [Validation documentation](http://laravel.com/docs/validation) of Laravel.\n\n\n\n### Ignore existing row (useful when updating)\n\nYou can also specify a row id to ignore (useful to solve unique constraint when updating)\n\nThis will ignore row with id 2\n\n```php\n\n$validator = Validator::make($request-\u003eall(), [\n      \n      \"\u003cfield1\u003e\" =\u003e'required|composite_unique:\u003ctable\u003e,\u003cfield1\u003e,\u003cfield2\u003e,ignore-\u003cprimaryKey\u003e-'.$id,\n    ]);\n```\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazbaul%2Fcomp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmazbaul%2Fcomp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazbaul%2Fcomp/lists"}