OK i'm new in Laravel and i need any help in my code. I'm trying to upload image in admin panel. but this image is uploading as tmp. Need i add something other code in my code?
public function store(Request $request)
{
if ($request->hasFile('contents')) {
$destinationPath = 'pictures/SliderImages';
$files = $request->contents;
$file_name = $files->getClientOriginalName();
$files->move($destinationPath, $file_name);
echo "Complete";
} else {
echo "No File";
}
$inputs = $request->all();
$sliders = Sliders::Create($inputs);
return redirect()->action('SliderController@index');
}
this is my blade
@foreach($sliders as $slider)
<tr>
<td></td>
<td></td>
<td><img src=""></td>
</tr>
@endforeach
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire