I try to make a unique validation the settings of my website but this doesn't work :
In my controller :
$rules = array(
'username' => 'required|unique:User,username,10',
'email' => 'required|email|unique:User,email,10',
'language' => 'required|in:fr,en',
);
My model:
class User extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
protected $primaryKey = 'id_user';
protected $table = 'user';
}
The problem is:
My Validator Validator::make(Input::all(), $rules, $messages);
fails, it says that this username and email already exist.