dimanche 30 juin 2019

How to get product Id from database in laravel

I'm trying to get the product Id from the database by using the hidden input but am stuck, I'm getting the error General error: 1366 Incorrect integer value: '[{"id":1}]' for column 'product_id'. How do I get the product Id from the database?

Code

Blade

   <input type="hidden" name="id" value="" />

Controller

     Image::create(array_merge($formInput,
   [
    $id=$request->input('id'),
    $product_id=Product::get('id'),
    'product_id' =>$product_id,

    ])); 

Any help will be appriciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire