title: Updating db field if data is present
body: <p>I cant seem to get my code working 100%.  I am trying to get my code to work in a way like this:</p>
  
  <p>if the column value is empty (<code>$id = columnName</code>) then insert into that row.  If there is a "value" found for that <code>$id</code> then update the value already saved in the DB.</p>
  
  <p><strong>Function:</strong></p>
  
  <pre><code>     $socialCheck = SocialSettings::where($id)-&gt;first();
  
         $socialInsert = new SocialSettings;
  
         $value        = Request::input('value'); 
  
  
         if(SocialSettings::where_not_null($id)){
  
             $socialInsert-&gt;$id = $value;
             $socialInsert-&gt;save();
     }else{
          $socialCheck-&gt;update($value);
  
     }
  
      }
  </code></pre>