Support the ongoing development of →
Database Eloquent Packages
Last updated 1 year ago.

Looks nice. When I did something similar (with no intention to make reusable though) I found I sometimes needed 4 validation rule sets (input on create/update and database data on create/update). A simplified example could be User and Password. Input data are 'login', 'password' and 'password confirmation' with rules for passwords however for database data you have got 'login' and 'password_hash'. Same for update.

Last updated 8 years ago.

@neomerx Things like password confirmation are applicable basically only during http request, when you're submitting a form, so there's no problem to do something like this:

// Form Request
public function rules()
   return array_merge(
        ['password' => 'confirmed']

Sure. However when you have all your rules in models and then you have to have some of them outside (e.g. in forms) you start thinking what you should do with it. So did I ;) Anyway you did a big job on coverage and fixing pesky scrutinizer issues :) Keep going, man


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.