public function unique($table, $col, $size, $withSpecialCharacters = false)
    {
        do {
            $token = $this->random($size, $withSpecialCharacters);

            $exists = DB::table($table)->where($col, $token)->exists();
        } while ($exists);

        return $token;
    }
public function unique($table, $col, $size, $withSpecialCharacters = false)
    {
        do {
            $token = $this->random($size, $withSpecialCharacters);

            $exists = DB::table($table)->where($col, $token)->exists();
        } while ($exists);

        return $token;
    }
public function unique ( $ table , $ col , $ size , $ withSpecialCharacters = false ) { do { $ token = $ this -> random ( $ size , $ withSpecialCharacters ) ; $ exists = DB :: table ( $ table ) -> where ( $ col , $ token ) -> exists ( ) ; } while ( $ exists ) ; return $ token ; }
Create a unique token.

@param string $table
@param string $col
@param integer $size
@param bool $withSpecialCharacters
@return string
@throws \Exception
Create a unique token .