I have form and inside it I have textfields, checkboxes, selects and FILE upload. What I need is to upload images only and pass the location of the images to controller so I can save them to db.
this is my controller:
public function spremi(){
$input= Request::all();
Oglas::create($input);
return redirect('other');
}
route:
Route::post('other', 'OglasController@spremi');
If I return the request, or create 'Oglas' for my database, only what I get is image name. And image is not uploaded anywhere? (ect. storage/.. , public/...).
{{Form::file('slike', ['class' => 'field']) }}
My question is: How to make things work the best way, so my images are uploaded to one folder, and only their correct location is saved in db?
I'm using Laravel 5.
