lundi 9 mars 2020

How do I extract the value from this collection to be inserted into a many to many table

How do I extract this collection ?

/*Collection */

Collection {#366
  #items: array:1 [
    "books" => array:2 [
      0 => array:2 [
        "id" => 4
        "description" => "Adipisci non enim vi"
      ]
      1 => array:2 [
        "id" => 6
        "description" => "Ex et alias et cum b"
      ]
    ]
  ]
}

to be inserted into a table called book_publisher which contains book_id publisher_id which is equal to the current publisher_id and also description equals to the book_details..



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire