title: how to show unix timestamp in blade view from created_at or updated_at field in database laravel?
body: <p>I want to get UNIX timestamp or convert created_at or updated_at date to UNIX timestamp format from database fields (created_at and updated_at) in laravel 5.8 , how can i do this?</p>
  
  <p><strong>this is my code in my controller :</strong></p>
  
  <pre><code>public function viewArchives(){
  $data = Archive::select(‘created_at’)-&gt;get();
  return view(‘view.archives’, compact(‘data’));
  }
  </code></pre>
  
  <p><strong>and in view/archives.blade.php :</strong></p>
  
  <pre><code>&lt;?php echo $data;?&gt;
  </code></pre>
  
  <p><strong>the result is :</strong></p>
  
  <pre><code>{“created_at”:”2019-03-17 19:10:30″}
  </code></pre>
  
  <p><strong>but i want the result be like this :</strong></p>
  
  <pre><code>{“created_at”:”1552849830″}
  </code></pre>
  
  <p>how can get this result?</p>