minhankyaw
1 year ago
146
9
Laravel

store image clientoriginalname in mysql database

Posted 1 year ago by minhankyaw

Hello , can anyone help me please . i can't save my image name into database.

that's my controller.

if (Input:: hasFile('image1')) { $image = Input::file('image1');

    $destinationpath = public_path('images');
    $imagename1 = $image->getClientOriginalName();
    $image->move($descriptionpath,$imagename1);
  }

$insert = array( 'image1' => "imagename1 ", ); DB::table('products') -> insert($insert);

Please sign in or create an account to participate in this conversation.