Add this cast in your model to automatically format the data when retrieving from or saving to the database:
protected function casts(): array { return [ 'completed_at' => 'datetime' ]; }