{"repo":"spatie/laravel-validation-rules","free":true,"listed":false,"github":"https://github.com/spatie/laravel-validation-rules","clone":"git clone https://github.com/spatie/laravel-validation-rules.git","description":"A set of useful Laravel validation rules","language":"PHP","stars":827,"topics":["laravel","php","validation","rules"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"A set of useful Laravel validation rules This repository contains some useful Laravel validation rules. Support us We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Installation You can install the package via composer: The package will automatically register itself. Translations If you wish to edit the package translations, you can run the following command to publish them into your resources/lang folder Available rules - Authorized - CountryCode - Currency - Enum - ModelsExist - Delimited Authorized Determine if the user is authorized to perform an ability on an instance of the given model. The id of the model is the field under validation Consider the following policy: This validation rule will pass if the id of the logged in user matches the user id on TestModel who's it is in the model id key of the request. Optionally, you can provide an authentication guard as the third parameter. Model resolution If you have implemented the getRouteKeyName method in your model, it will be used to resolve the model instance. For further information see Customizing The Default Key Name CountryCode Determine if the field under validation is a valid 2 letter ISO3166 country code (exam","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/laravel-validation-rules/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}