You need the code below before everything else.
public function upload(Request $request) {
$this->validate($request, [
'picture' => 'required|mimeType:jpeg,jpg,png|max:10000',
]);
// Continue with the upload process below....
}
What this code does it validate your request before moving on and doing anything else, then you can get the file after it is validated and continue with the upload process.
I have tryed, but same result. I will be redirected to the upload page, doesent matter, what i upload. Is it not the same (validation) like
$validator = \Illuminate\Support\Facades\Validator::make($request->all(), $rules);
but that i will not be redirected and can interpret the result from $validator?
Jan
Has no one an answer to this "basic" question? .
Jan
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community