/**
  * Format the SQL error message.
  * 
  * Overriden to support extended types like arrays and objects.
  *
  * @param  string  $sql
  * @param  array  $bindings
  * @param  \Exception $previous
  * @return string
  */
 protected function formatMessage($sql, $bindings, $previous)
 {
     $preparedBindings = $this->prepareBindings($bindings);
     return $previous->getMessage() . ' (SQL: ' . Str::replaceArray('?', $preparedBindings, $sql) . ')';
 }
示例#2
0
 /**
  * Replace a given value in the string sequentially with an array.
  *
  * @param  string  $search
  * @param  array   $replace
  * @param  string  $subject
  * @return string
  */
 function str_replace_array($search, array $replace, $subject)
 {
     return Str::replaceArray($search, $replace, $subject);
 }
 /**
  * Format the SQL error message.
  *
  * @param  string  $sql
  * @param  array  $bindings
  * @param  \Exception $previous
  * @return string
  */
 protected function formatMessage($sql, $bindings, $previous)
 {
     return $previous->getMessage() . ' (SQL: ' . Str::replaceArray('?', $bindings, $sql) . ')';
 }