.
and the html form:
<form>
<input type="text" name="fc_fullname" placeholder="Full Name" />
<input type="email" name="fc_email_addr" placeholder="Email Address" />
<input type="password" name="fc_pwd" placeholder="Password" />
<input type="password" name="fc_pwd_confirmation" placeholder="Repeat Password" />
</form>
.
and the validation code is:
Validator::make($request->all(), [
'fc_fullname' => 'required|string|max:255|exists:admins,name',
'fc_email_addr' => 'required|string|email|max:255|unique:admins,email',
'fc_pwd' => 'required|string|min:6|confirmed|exists:admins,password',
])->validate();
.
.
So, currently, I am able to use custom column name
by using exists
and unique
Validation rules.
But I don't want to use the exists
rule. I just want to specify custom column name ONLY.
Is there any other rules or trick to specify the column name in database table?
exists
will check if the value exist in the table. If value already exist, the value is VALID. And forunique
, it also will check if the value exist in the table. But for this rule, if value already exist, the value is INVALID. I already state 'What I want try to achieve' in the question. Stackoverflow is for all people around the world, so you should be ready to understand english in different slang or different accent. By the way, answer from @GAURAV VAGHELA is what I am looking for. I already mark his answer as the correct answer. Thanks – Syamsoul Azrien