lundi 20 janvier 2020

how can update data multiple insert with tabel Model EAV laravel

I have a multiple update form, here my company uses the EAV model table, entity value value, how do I update the data with the eav data model, The following is the data that I sent

"name" => array:2 [
    0 => "mantap"
    1 => "mantap mantap"
  ]
  "category" => array:2 [
    0 => "sales"
    1 => "admin"
  ]
  "duration" => array:2 [
    0 => "12"
    1 => "10"
  ]
  "discount_status" => array:2 [
    0 => "no"
    1 => "yes"
  ]
  "percentage_discount" => array:2 [
    0 => "0"
    1 => "70"
  ]

and this my tabel

  _____________________________________________________
id |client_id |client_detail_name |client_detail_value|
1  |   1      |name               | mantap            |
2  |   1      |categori           | sales             |
3  |   1      |duration           | 12                |
4  |   1      |discount_status    | no                |
5  |   1      |percentage_discount| 0                 |
6  |   1      |name               | mantap mantap     |
7  |   1      |categori           | admin             |
8  |   1      |duration           | 10                |
9  |   1      |discount_status    | yes               |
10 |   1      |percentage_discount| 70                |

I tried to put it in an array and update it based on the value before changing it, I've tried various methods, but it never worked, this my code update data, sorry I put it apart because it's too long https://pastebin.com/sTe3MDyJ does anyone have an idea to make an update?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire