title: Laravel make merged created_at and updated_at timestamps
body: <p>In a <strong>model</strong> I have created custom timestamps:</p>
  
  <pre><code>const CREATED_AT = 'fil_ts';
  const UPDATED_AT = 'fil_ts';
  </code></pre>
  
  <p>Basically the idea is that <strong>CREATED_AT</strong> timestamp will get updated whenever record is changed (<strong><em>in other words: I would have just one timestamp which acts as created and updated timestamp</em></strong>). </p>
  
  <p><em>How do I make these custom timestamps appear in the database's table trough migrations? Do I need to create them in the migration file when I create the table?</em></p>
  
  <hr>
  
  <p><strong>1. Do i need to define custom timestamps in migration like this</strong></p>
  
  <pre><code>$table-&gt;timestamp('fil_ts');
  $table-&gt;timestamp('fil_ts');
  </code></pre>
  
  <p><strong>2. or like this</strong> </p>
  
  <pre><code>$table-&gt;timestamps();
  </code></pre>
  
  <p>So far neither of these methods worked. With the first method I get an error that I can't have same named variables (which is logical, but I don't know other way how to make SINGLE timestamp act as CREATED_AT and UPDATED_AT).</p>
  
  <p>If I use the second method it just creates default timestamps.</p>
  
  <p><strong>My end goal</strong>: a single custom timestamp that acts like created_at and updated_at. First it gets creation timestamp and then it keeps updated.</p>
  
  <hr>
  
  <h2>Update</h2>
  
  <p>Even if the custom timestamps names are different I still get error when I run php artisan migrate:</p>
  
  <p><strong>Timestamps in the model:</strong></p>
  
  <pre><code>   const CREATED_AT = 'file_created';
     const UPDATED_AT = 'file_updated';
  </code></pre>
  
  <p><strong>Timestamps in the migration:</strong></p>
  
  <pre><code> $table-&gt;timestamp('file_created');
   $table-&gt;timestamp('file_updated');
  </code></pre>
  
  <blockquote>
    <p>Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: Syntax error or
    access violation: 1067 Invalid default value for 'file_updated'")</p>
  </blockquote>
  
  <h2>Solution</h2>
  
  <p><strong>Code in the model:</strong>
  <em>Need to disable default timestamps</em></p>
  
  <pre><code>public $timestamps = false; 
  const CREATED_AT = 'fil_ts';
  const UPDATED_AT = 'fil_ts';
  </code></pre>
  
  <p><strong>Code in the migration</strong></p>
  
  <pre><code>$table-&gt;timestamp('fil_ts'); 
  </code></pre>