当/如果X时执行SQL查询

I have the following INSERT:

        $id = \DB::table('log')
      ->insert(array(
        "account_id" => $this->get("account_id"),
        "type" => "Edit info",
        "done" => "0"
      ));

How could I adapt it in order to be executed only when there are no previous entries like this inside log table?

account_id: 1 // type: Edit info // done: 0

I need to avoid repeating entries (no same entries if the user already requested edit his/her info and it wasn't done by an admin yet).

You can use updateOrInsert method.

$id = \DB::table('log')->updateOrInsert(array(
  "account_id" => $this->get("account_id"),
  "type" => "Edit info",
  "done" => "0"
));