I am facing some issue in validation. below is my code
I have two fields in database
user & Address
in user.blade i have input field
<input type="text" name"username"/>
@if(errors->has('user'))
@endif
in controller i have method:
public function store(Request $request)
{
$this->validate(request(),[
'user'=>'required'
]);
}
If i use above code, the validation is not working, but when i change the input field name 'username' to 'user' its start working. is that compulsory to use the same input field name which is in db ???? or any other way to fix this problem ?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lnbH4o
via IFTTT
Aucun commentaire:
Enregistrer un commentaire