Let's say, I have a User model in Laravel like this:
class User extends Eloquent implements UserInterface, RemindableInterface {
public static $rules = array(
'email' => 'required|email',
'password' => 'required|min:8|confirmed',
'password_confirmation' => 'required|min:8'
);
...
}
Rules, stored in model, will be reused both for login and register forms but problem occurs when there's no need for password confirmation (e.g. login form). And there could be many such situations where the rules should be changed.
So, is there any pure method how to modify model-stored validation rules for different cases in Laravel? Do I have to reorganize my rule storage approach at all?
Thanks!