Skip to content

Commit 9136db1

Browse files
committed
wip - tidy scope
1 parent 7bf7b15 commit 9136db1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/Models/Article.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function scopePublished(Builder $query): void
2424
{
2525
$query
2626
->orderByDesc('published_at')
27+
->whereNotNull('published_at')
2728
->where('published_at', '<=', now());
2829
}
2930

database/migrations/2025_07_08_083141_create_articles_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function up(): void
2626
$table->string('excerpt', 400);
2727
$table->text('content');
2828

29-
$table->timestamp('published_at')->default(now());
29+
$table->timestamp('published_at')->nullable();
3030
$table->timestamps();
3131
});
3232
}

0 commit comments

Comments
 (0)