foreign key constraint is incorrectly formed connecting with pivot table
<p>I'm connecting the pivot table but it's constantly calling this error </p>

<pre><code> SQLSTATE[HY000]: General error: "Foreign key constraint is incorrectly formed")
</code></pre>

<p>This is column in question </p>

<pre><code>$table-&gt;increments('id'); (the id which should be primary key)

$table-&gt;integer('qu', false); (the column that is connected to pivot table
</code></pre>

<p>This is in pivot table</p>

<pre><code>        $table-&gt;integer('quick_id')-&gt;unsigned()-&gt;index();
        $table-&gt;foreign('quick_id')-&gt;references('qu')-&gt;on('speed')-&gt;onDelete('cascade');
</code></pre>