title: Check if string is already in database or not in Laravel 5.2
body: <p>Here is my code</p>
  
  <pre><code>$string = str_random(20);
  $get_token = DB::table('users')-&gt;select('token')-&gt; get();
  </code></pre>
  
  <p>now I want to compare <code>$string</code> with <code>$get_token</code> . if it is not in database then it should add to database with the value <code>$string</code> has. </p>
  
  <p>I have written this code.</p>
  
  <pre><code>if(strcmp($string , $get_token) !=0){
  //add to DB
  }
  </code></pre>
  
  <p>How can i compare my string to each of the string which is already in database.</p>
  
  <p>Thank You</p>