Comments (6)
I don’t understand the question, could you give some more context as to what you’re trying to achieve?
from validating.
hi, I would like to create a custom validation, for example I would like to check that a precise code is selected in an input field of the page, it's possible ?
br
Max
from validating.
Yes, just write a custom validation rule. The Laravel docs show you how to do this. Then just add your rule to the rules array on the model. This library just uses Laravel’s validation under the hood. Let me know if you have any issues with this.
from validating.
I tried to understand how to make a custom rule and associate it with the rules of your plugin, but I can not figure out how to do it, I will try to do other tests.
I created a custom rule for uppercase, and I was thinking of doing this: 'targa' => 'required | uppercase', but I think I'm wrong to do so
br
Max
from validating.
I'm not sure how more I can help apart from writing the code for you. Look at this page to see how to write custom validators for Laravel - using classes or extensions (you can't use the closure syntax with this package at this stage): https://laravel.com/docs/5.6/validation#custom-validation-rules
Then you just add those new rules to the $rules
array on the model you want to validate. It would work just the same as if you were using Laravel's validator by itself.
from validating.
Actually it's possible that only the validator extensions work at the moment (not classes or closure syntax: #200).
from validating.
Related Issues (20)
- Update to laravel 5.7 HOT 1
- Add custom error to Model HOT 1
- A suggestion to improve performValidation() function HOT 5
- Question about usage HOT 1
- Column names in message bag spaces HOT 2
- [Sugestion] Add Validate Field HOT 1
- Just a note regarding the readme.md HOT 2
- Custom validation rule in the model HOT 1
- How to support different validations rules e.g. on update? HOT 1
- Laravel 6 Support
- Laravel 7.x support HOT 3
- Issue with Laravel 7.x custom Casts and validation HOT 4
- Support laravel 8 HOT 3
- ValidationException: Change $message when an ValidationException occurs during Tests? HOT 2
- Lost Laravel 6 support HOT 2
- MessageBag emtpy when using "Unique" rule on transaction HOT 2
- Add isEncryptedCastable HOT 4
- Validation of dynamic attributes during model creation HOT 3
- Failed requirements for Laravel-10
- Add support for Laravel 11 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from validating.