I am updating data and want to ignore the email of the login user so I am using ignore in validation but is not working and is giving an error. as I have created a custom login without using modal.
function updateemployee(Request $request)
{
$val=Session::get('Email');
$request->validate([
'Email' => ['required', Rule::unique('employee')->ignore($this->employee)]
]);
CodePudding user response:
You need use code this way.
function updateemployee(Request $request, $employeeId)
{
$val=Session::get('Email');
$request->validate([
'Email' => ['required', Rule::unique('employee')->ignore($employeeId)]
]);
CodePudding user response:
$validated = $request->validate([ 'title' => 'required|unique:posts|max:255', 'body' => 'required', ]);