daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $friends = collect([
  4.     ['first_name' => 'Rachel', 'last_name' => 'Green'],
  5.     ['first_name' => 'Monica', 'last_name' => 'Geller'],
  6.     ['first_name' => 'Phoebe', 'last_name' => 'Buffay'],
  7.     ['first_name' => 'Joey', 'last_name' => 'Tribbiani'],
  8.     ['first_name' => 'Chandler', 'last_name' => 'Bing'],
  9.     ['first_name' => 'Ross', 'last_name' => 'Geller'],
  10. ]);
  11.  
  12.  
  13.  
  14. $filtered = $friends->whereNotIn('last_name', 'Geller');
  15.  
  16. $filtered->all();
  17.  
  18. /*
  19. [
  20.      0 => [
  21.        "first_name" => "Rachel",
  22.        "last_name" => "Green",
  23.      ],
  24.      2 => [
  25.        "first_name" => "Phoebe",
  26.        "last_name" => "Buffay",
  27.      ],
  28.      3 => [
  29.        "first_name" => "Joey",
  30.        "last_name" => "Tribbiani",
  31.      ],
  32.      4 => [
  33.        "first_name" => "Chandler",
  34.        "last_name" => "Bing",
  35.      ],
  36.    ]
  37.  
  38.  */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top