Skip to content

Black Deer Dev

Black Deer Dev
Black Deer Dev
  • Home
  • About
  • Blog
  • Longform
  • Portfolio
  • Home
  • About
  • Blog
  • Longform
  • Portfolio

Collections

Merge Two Collections Containing Same IDs In Laravel

March 17, 2020February 13, 2020 by Johnnyparky

Let’s say you have two Collections with the same ID. $a = collect([ ‘id’ => 1, ‘name’ => ‘Johnny’ ]); $b = collect([ ‘id’ => 1, ‘age’ => 14 ]); There’s not a helper to merge the two for a result like this. $c = [ ‘id’ => 1, ‘name’ => ‘Johnny’, ‘age’ => 14]; … Read more

Leave a comment

Categories

  • Blog
  • Longform
  • Portfolio
  • Review
  • Uncategorized

About

About me

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Categories

  • Blog
  • Longform
  • Portfolio
  • Review
  • Uncategorized

Tags

Active Record Ajax Axios Bash Browser Cache Carbon Case Sensitive Composer Currency Eloquent Error GraphQL Heroku Index Ionic Javascript Keyboard Laravel Memory Migration Network Npm osx Passport pear pecl PHP Postgres Production Query Query Builder Rails Redis Relationships Ruby S3 Scraper SQL Telescope Upload Validation Vue Vuex zsa
© 2025 Black Deer Dev