Well, I have a form where it contains an html input of an image. When I send the form to the Control, I do the image processing, taking its name and uploading it to the image directory. But when I look in the bank, the image name is not correct. See next image - >
Then with this problem I can not get the image, since the names do not match (The name of the directory! = the name of the bank). Here's how I'm doing:
if ($request->hasFile('imagem')) {
$imagem = $request->file('imagem');
$filename = time() . '.' . $imagem->getClientOriginalExtension();
Image::make($imagem)->resize(100, 100)->save(public_path('/imagem/igreja/membros/' . $filename));
$all = $request->all();
$membro->imagem = $filename ;
$return = $membro->create(
$all
);
if ($return)
return redirect()->route('membro.index')->with('msg', 'Membro cadastrado com sucesso!');
else
return redirect()->back();
}
The information goes, the more the image will not. I'm seriously afraid of having to do it this way:
$membro->create(['Imagem' => 'value','...' => '....' ] );
Because I have a large form and it would foul my controlller.