Skip to content

Commit a24d32a

Browse files
committed
Default for createdAt
1 parent b8545bb commit a24d32a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/Models/Post.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ protected static function booted()
4040
self::creating(function (Post $post) {
4141
$post->state ??= PostState::PENDING;
4242
$post->uuid ??= Uuid::uuid4()->toString();
43+
$post->created_at ??= now();
4344
});
4445

4546
self::saving(function (Post $post) {

0 commit comments

Comments
 (0)