I am trying to upload an image into the database but unfortunately it is not inserting an image into the database. How can I fix it?
Database table: https://ibb.co/3sT7C2N
Controller
public function Add_slider(Request $request) { $this->validate($request, [ 'select_image' => 'required' ]); $content = new Sliders; if($request->file('select_image')) { $content->slider_image = Storage::disk('')->putFile('slider', $request->select_image); } $check = Sliders::create( $request->only(['slider_image' => $content]) ); return back() ->with('success', 'Image Uploaded Successfully') ->with('path', $check); }
Storageyou want to store the image in the database as well? Or You want to store the file in the Storage and keep the file path in the database?