Skip to content

Conversation

@armanist
Copy link
Member

This PR adds opt-in automatic timestamps for DbModel via the new HasTimestamps trait.
Models using the trait automatically manage created_at (on insert) and updated_at (on insert/update), with support for custom column names and unix/datetime formats.
Manual timestamp assignments were removed from demo services/controllers where redundant, and unit tests were added to cover default + custom behavior.

@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

❌ Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.46%. Comparing base (3c5fbce) to head (e60f11c).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/Model/Traits/SoftDeletes.php 88.88% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #411      +/-   ##
============================================
+ Coverage     80.84%   81.46%   +0.62%     
- Complexity     2669     2685      +16     
============================================
  Files           238      239       +1     
  Lines          7114     7147      +33     
============================================
+ Hits           5751     5822      +71     
+ Misses         1363     1325      -38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@armanist armanist added the help wanted Extra attention is needed label Jan 25, 2026
@armanist armanist added this to the 3.0.0 milestone Jan 25, 2026
@armanist armanist linked an issue Jan 25, 2026 that may be closed by this pull request
Copy link
Collaborator

@charoyan88 charoyan88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes

@armanist armanist requested a review from charoyan88 January 26, 2026 15:51
@armanist armanist merged commit 12a4b1f into softberg:master Jan 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Optional Timestamps Support to Models

4 participants