public function affectingStatement($query, $bindings = [])
{
return $this->run($query, $bindings, function ($me, $query, $bindings) {
if ($me->pretending()) {
return 0;
}
// For update or delete statements, we want to get the number of rows affected
// by the statement and return that back to the developer. We'll first need
// to execute the statement and then we'll use PDO to fetch the affected.
$statement = $me->getPdo()->prepare($query);
$this->bindValues($statement, $me->prepareBindings($bindings));
$statement->execute();
return $statement->rowCount();
});
}