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 Composer Currency Docker Eloquent Error Git GraphQL Heroku Ionic Javascript Laravel Mac Memory Migration MySql Network Nginx Npm osx Password pear pecl PHP Postgres Query Query Builder Rails Redis Relationship Relationships Ruby S3 Schema Scraper SQL Upload Validation Vue Vuex
© 2023 Black Deer Dev