mardi 31 mai 2016

Making unique field validation while updating

I am trying to validate for the unique record While editing but it always displays the field must be unique. basically i need to ignore the value of that id. id is the primary key.

$validator=Validator::make($request->all(),[
'name'=>'required',
'telephone'=>'required|unique:telephone',
'email'=>'unique:telephone',
'altemail'=>'unique:telephone',
'image'=>'image',

]);

if($validator->fails()){
return redirect('/telephone/addview')
    ->withErrors($validator);   
     }



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1THM7ji
via IFTTT

Aucun commentaire:

Enregistrer un commentaire