Welcome Guest, Not a member yet? Register   Sign In
File Validation with redirect
#2

(This post was last modified: 11-03-2021, 12:40 AM by manager.)

(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.
Reply


Messages In This Thread
File Validation with redirect - by pyst4r1983 - 11-02-2021, 07:54 AM
RE: File Validation with redirect - by manager - 11-03-2021, 12:37 AM
RE: File Validation with redirect - by pyst4r1983 - 11-09-2021, 02:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB