title: Laravel - Unknown column in field list
body: <p>Mates, I'm havin a problem to save a record to the database.
  As I understand the error, it seems as it doesn't exist an 'id_purchase' in the table. But it does.
  The code I'm using is the following:</p>
  
  <pre><code>&lt;?php
  
  class Purchproducts_Controller extends Base_Controller {
  
      public $restful = true;    
  
      public function get_index()
      {
          $purchases = Purchproduct::where('id_hostel', '=', Session::get('id_hostel'))-&gt;get();
          $response = array();
          foreach($purchases as $purch){
              $response[] = $purch-&gt;attributes;
          }
          return json_encode($response);
      }    
  
      public function post_create()
      {
          $data = Input::json();
          $purchase = Purchproduct::create(
              array(
                  'id_hostel' =&gt; Session::get('id_hostel'),
                  'id_products' =&gt; $data-&gt;id_products,
                  'id_purchase,' =&gt; $data-&gt;id_purchases,
                  'qty' =&gt; $data-&gt;qty
              )
          );
  
          return json_encode($purchase-&gt;attributes);
      }  
  }
  </code></pre>
  
  <p>The error screen:</p>
  
  <pre><code>Unhandled Exception
  Message:
  
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id_purchase,' in 'field list'
  
  SQL: INSERT INTO `ehm_purchproducts` (`id_hostel`, `id_products`, `id_purchase,`, `qty`, `updated_at`, `created_at`) VALUES (?, ?, ?, ?, ?, ?)
  
  Bindings: array (
    0 =&gt; 1,
    1 =&gt; '2',
    2 =&gt; 2,
    3 =&gt; '12',
    4 =&gt; '2013-04-16 22:00:32',
    5 =&gt; '2013-04-16 22:00:32',
  )
  
  Location:
  
  /home/pablo/htdocs/insdev/laravel/laravel/database/connection.php on line 263
  
  Stack Trace:
  
  #0 /home/pablo/htdocs/insdev/laravel/laravel/database/connection.php(183): Laravel\Database\Connection-&gt;execute('INSERT INTO `eh...', Array)
  #1 /home/pablo/htdocs/insdev/laravel/laravel/database/query.php(823): Laravel\Database\Connection-&gt;query('INSERT INTO `eh...', Array)
  #2 [internal function]: Laravel\Database\Query-&gt;insert_get_id(Array, 'id')
  #3 /home/pablo/htdocs/insdev/laravel/laravel/database/eloquent/query.php(283): call_user_func_array(Array, Array)
  #4 /home/pablo/htdocs/insdev/laravel/laravel/database/eloquent/model.php(390): Laravel\Database\Eloquent\Query-&gt;__call('insert_get_id', Array)
  #5 /home/pablo/htdocs/insdev/laravel/laravel/database/eloquent/model.php(390): Laravel\Database\Eloquent\Query-&gt;insert_get_id(Array, 'id')
  #6 /home/pablo/htdocs/insdev/laravel/laravel/database/eloquent/model.php(205): Laravel\Database\Eloquent\Model-&gt;save()
  #7 /home/pablo/htdocs/insdev/laravel/application/controllers/purchproducts.php(27): Laravel\Database\Eloquent\Model::create(Array)
  #8 [internal function]: Purchproducts_Controller-&gt;post_create()
  #9 /home/pablo/htdocs/insdev/laravel/laravel/routing/controller.php(325): call_user_func_array(Array, Array)
  #10 /home/pablo/htdocs/insdev/laravel/laravel/routing/controller.php(285): Laravel\Routing\Controller-&gt;response('create', Array)
  #11 /home/pablo/htdocs/insdev/laravel/laravel/routing/controller.php(165): Laravel\Routing\Controller-&gt;execute('create', Array)
  #12 /home/pablo/htdocs/insdev/laravel/laravel/routing/route.php(153): Laravel\Routing\Controller::call('purchproducts@c...', Array)
  #13 /home/pablo/htdocs/insdev/laravel/laravel/routing/route.php(124): Laravel\Routing\Route-&gt;response()
  #14 /home/pablo/htdocs/insdev/laravel/laravel/laravel.php(167): Laravel\Routing\Route-&gt;call()
  #15 /home/pablo/htdocs/insdev/laravel/public/index.php(34): require('/home/pablo/htd...')
  #16 {main}
  </code></pre>
  
  <p>The table structure:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `ehm_purchproducts` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `id_hostel` int(11) NOT NULL,
    `id_products` int(11) NOT NULL,
    `id_purchase` int(11) NOT NULL,
    `recibo` varchar(200) COLLATE utf8_spanish_ci NOT NULL,
    `qty` int(11) NOT NULL,
    `created_at` datetime NOT NULL,
    `updated_at` datetime NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=1 ;
  </code></pre>
  
  <p>Any ideas?</p>