(11-02-2021, 07:54 AM)pyst4r1983 Wrote: When I add ->with('validation', $this->validator) the statusError and the validation is not shown
PHP Code:
if(!$this->validate($this->validation_edit_profile_image())):
return redirect()->back()
->with('statusError', lang('system/auth/pages/edit_profile_image.messages.error.edit_profile_image'))
->with('validation', $this->validator);
else:
// image upload itself working fine
endif;
The problem is when you return redirect()->back()->with('validation', $this->validator) second parameter should be string or an array.
In you code you're setting as a parameter validation class object.
Your code should be like
PHP Code:
redirect()->back()->with('validation', $this->validator->getErrors())
It sets validation errors as flash data in session.