Hello,
i have a scenario where i am using the rainlab users with username. There are users who have the same emails but in the Users Model the validation is
public $rules = [
'email' => 'required|between:3,255|email|unique:users',
];
I want to remove the “unique:users” filters. I used the following
\RainLab\User\Models\User::extend(function($model) {
$model->bindEvent('model.beforeSave', function() use ($model) {
$validator = \Validator::make($model->attributes, [
'email' => 'required|between:3,255|email',
]);
});
});
But it is still using the unique filter. Thanks in advance.