Skip to content

Instantly share code, notes, and snippets.

@minedun6
Created September 13, 2018 15:05
Show Gist options
  • Save minedun6/9c73993535aa99480a64db39a6c0b9f3 to your computer and use it in GitHub Desktop.
Save minedun6/9c73993535aa99480a64db39a6c0b9f3 to your computer and use it in GitHub Desktop.
Flash out the invalid usernames
<?php
$allUserNames = explode(',', $userNames);
$validUserNames = Contact::whereIn('user_name', $allUserNames)
->pluck('user_name')
->toArray();
$invalidUserNames = array_values(array_diff($allUserNames, $validUserNames));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment