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