Giter Club home page Giter Club logo

rule-builder's Issues

Error / overwrite on duplicate rules

Perhaps a strict option that throws an exception when duplicate rules are added and a non-strict option that just utilises the last declared rule.

Return array instead of string

This package looks really nice, but there's one thing I would change to make it much more efficient.

When you provide a string separated by pipes to the Laravel validator, it splits the string back into an array immediately. Therefore, I suggest that you just return the array instead of concatenating the rules back into a string. You already have the array and that's exactly how Laravel is going to use it, so why not?

In most of my projects until this point, I have specified my validation rules as arrays instead of strings in my code.

This package is awesome

This is exactly what I was looking for. The laravel validation strings are hard to remember, hard to read, and take forever to write. This solves all those problems. Well done on this, mate.

Default helpers values

Allow default helpers values. With this a user could set the email rule to have a default max:255 rule also applied.

Thus...

Rule::email(255)->get() === Rule::email()->get()

Match migration builder

would be nice to match the migration builder schema as much as possible. See of there are any additions that can be made to make this match more.

Carbon instances for dates

Worthwhile allowing Carbon to be used more closely with date rules, either carbon constants or carbon instances? after:date for example.

Riff on removing call to `get`

Would love to be able to remove the call to get. Maybe array accessible, but maybe check through validator source to see if there are array type hints specifically

Allow prepend urls with schema

Allow a global setting to auto-prepend urls with a schema.

I often have users submitting urls like www.github.com which doesn't validate with the url validation rule because it doesn't have a scheme.

Would be sweet to do in a service provider:

Rule::prependUrlScheme('http://');

or inline like

$rules = [
    'website' =>Rule::required()->url(255)->prependScheme('http://')->get(),
];

Adding custom validation

Is there any mechanism in this to add custom validation rules. Or are there any plan on doing so.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.