title: Eloquent Foreign Key to Same Table
body: <p>In Laravel 4's Eloquent,</p>
  
  <p>i have a table <code>user</code> and a field <code>user.friend_id</code> which is an also an id of a user.. </p>
  
  <p>but when i try to create a new user with friend_id = 0, the foreign key fails..</p>
  
  <p>and when friend_id = 1, it succeeds.</p>
  
  <p>I have this in my user's schema builder </p>
  
  <pre><code>$table-&gt;unsignedInteger('friend_id')-&gt;default(0)-&gt;nullable(); 
  </code></pre>
  
  <p>what should I be doing here?</p>
  
  <p>should i have just created a pivot table instead?</p>
  
  <p>thanks!</p>