title: Input Sanitising Laravel 4
body: <p>I am using Laravel 4 to create a RESTful interface for my AngularJS app.</p>
  
  <p>At the moment, I want to update an object. My model is called <code>Discount Link</code> The way I do this is:</p>
  
  <pre><code>    $data = Input::all();
      $affectedRows = DiscountLink::where('id', '=', $id)-&gt;update($data);
  </code></pre>
  
  <p>(Please imagine there are some kind of validation checks)</p>
  
  <p>I get an error in my <code>laravel.log</code>:</p>
  
  <pre><code>General error: 1 no such column: $edit
  </code></pre>
  
  <p>Edit is a value that was passed to my server because it was added in by angular. I don't see the need to explicitly remove this in my JS so my question is:</p>
  
  <p>How can I create some kind of whitelist of key-names that my model will pay attention to. That way, even if something get's passed in by accident, the REST call doesn't have to fail.</p>
  
  <p>I guess there are arguments for sanitising in the JS but i will then pollute my code with many de-assignment statements which could become messy, especially when dealing with AngularJS:</p>
  
  <pre><code>delete discountLink.$edit;
  </code></pre>
  
  <p>Any suggestions?</p>