title: How to change format of created_at and updated_at in laravel Model?
body: <p>In laravel response I want to get values of &quot;created_at&quot; and 'updated_at&quot; like this format (without seconds):</p>
  <pre><code>2022-02-22 04:07
  </code></pre>
  <p>I try to use :</p>
  <pre><code>protected $casts = [
      'created_at'  =&gt; 'datetime:Y-m-d H:i',
      'updated_at' =&gt; 'datetime:Y-m-d H:i'
  ];
  </code></pre>
  <p>But not works, the datetime stills in default format.</p>