title: How to seed timestamps on laravel 4.1?
body: <p>Good day,</p>
  
  <p>I was having an error "Object of class DateTime could not be converted to string" when Im trying to seed my database.</p>
  
  <p>here is my migration code:</p>
  
  <pre><code>    public function up()
  {
      Schema::create('tblinventory', function(Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;integer('itemId');
          $table-&gt;enum('status', array('active','inactive'))-&gt;default(null)-&gt;nullable();
          $table-&gt;float('purchasePrice');
          $table-&gt;float('sellingPrice');
          $table-&gt;date('expirationDate');
          $table-&gt;float('ReceivedQuantity');
          $table-&gt;float('soldQuantity');
          $table-&gt;timestamps();
      });
  }
  </code></pre>
  
  <p>and my seeder:</p>
  
  <pre><code>&lt;?php
  
  class InventoryTableSeeder extends Seeder {
  
  public function run()
  {
      // Uncomment the below to wipe the table clean before populating
      DB::table('tblinventory')-&gt;truncate();
  
      $insert = [
          [
          'itemId' =&gt; '1', 
          'status' =&gt; 'inactive',
          'ReceivedQuantity'=&gt;'100',
          'SoldQuantity'=&gt;'93',
          'sellingPrice'=&gt;'4.5',
          'purchasePrice'=&gt;'3.5',
          'created_at' =&gt; new DateTime,
          'expirationDate'=&gt;date('2015-02-22')
          ],
          [
          'itemId' =&gt; '1', 
          'status' =&gt; 'inactive',
          'ReceivedQuantity'=&gt;'300',
          'SoldQuantity'=&gt;'300',
          'sellingPrice'=&gt;'4.75',
          'purchasePrice'=&gt;'3.65',
          'expirationDate'=&gt;date('2015-02-22')
          ],
          [
          'itemId' =&gt; '2', 
          'status' =&gt; 'inactive',
          'ReceivedQuantity'=&gt;'100',
          'SoldQuantity'=&gt;'93',
          'sellingPrice'=&gt;'3.5',
          'purchasePrice'=&gt;'2.5',
          'expirationDate'=&gt;date('2014-07-22')
          ],
          [
          'itemId' =&gt; '3', 
          'status' =&gt; 'inactive',
          'ReceivedQuantity'=&gt;'100',
          'SoldQuantity'=&gt;'93',
          'sellingPrice'=&gt;'12.5',
          'purchasePrice'=&gt;'10.5',
          'expirationDate'=&gt;date('2017-01-02')
          ],
          [
          'itemId' =&gt; '3', 
          'status' =&gt; 'inactive',
          'ReceivedQuantity'=&gt;'100',
          'SoldQuantity'=&gt;'100',
          'sellingPrice'=&gt;'14.5',
          'purchasePrice'=&gt;'13.5',
          'expirationDate'=&gt;date('2017-07-22')
          ],
          [
          'itemId' =&gt; '4', 
          'status' =&gt; 'inactive',
          'ReceivedQuantity'=&gt;'100',
          'SoldQuantity'=&gt;'93',
          'sellingPrice'=&gt;'24.5',
          'purchasePrice'=&gt;'23.5',
          'expirationDate'=&gt;date('2015-07-22')
          ]
  
      ];
  
      DB::table('tblinventory')-&gt;insert($insert);
      // Uncomment the below to run the seeder
      // DB::table('inventories')-&gt;insert($inventories);
  }
  
  }
  </code></pre>
  
  <p>I get the error when I put <code>'created_at'=&gt; new DateTime</code>. How can I fix this? thank you!</p>