Sanzeeb Aryal Sanzeeb Aryal - 1 year ago 53
PHP Question

Laravel validator only displaying message after reloading

I am trying to validate the image using validator


return redirect('/pop/add')

But when i add the file except the image it is displaying
MethodNotFound Exception
instead of the error message and when i reload the page it then displays the validation error message.

The view looks like:

<form method="POST" action="{{url('/pop/add')}}" role="form" enctype="multipart/form-data">
{!! csrf_field() !!}
<label>Upload your photo:</label><input type="file" name="image" ><br>

and the route:



You should redirect to '/pop/addview' instead of '/pop/add'.

return redirect('/pop/addview')