Syntax error with single quotes in Laravel 5 Eloquent Query Builder
<p>I've been trying to write a massive <code>update</code> query with a <code>where</code> clause, and I've found that Laravel 5.3 Eloquent Query Builder makes a syntax error.</p>

<p>The query is the following:</p>

<pre><code>$query = $this-&gt;model
    -&gt;where('state', "pending")
    -&gt;whereRaw('created_at &lt;= NOW() - INTERVAL 12 HOUR')
    -&gt;update(['state' =&gt; "timeout"]);
</code></pre>

<p>Which is translated to this:</p>

<pre><code>update `orders`
set `state` = timeout, `updated_at` = 2016-09-21 21:47:39
where `state` = pending and created_at &lt;= NOW() - INTERVAL 12 HOUR
</code></pre>

<p>This query keeps failing since the values for the columns <code>state</code> and <code>updated_at</code> are not written with single quotes.</p>

<p>How can I force Laravel to write to put the single quotes correctly?</p>