diff --git a/app/Http/Controllers/NewsController.php b/app/Http/Controllers/NewsController.php index 0d7eb6f..d47f295 100644 --- a/app/Http/Controllers/NewsController.php +++ b/app/Http/Controllers/NewsController.php @@ -68,7 +68,7 @@ public function store(StoreNewsRequest $request): RedirectResponse */ public function show(Request $request, News $news): Response { - $request->user()->pigeon->news()->updateExistingPivot($news->id, ['is_read' => true]); + $request->user()->pigeon->news()->updateExistingPivot($news->id, ['is_read' => true], false); return Inertia::render('News/Show', [ 'news' => NewsData::from($news), diff --git a/database/migrations/2023_10_20_080404_create_pigeon_messages_table.php b/database/migrations/2023_10_20_080404_create_pigeon_messages_table.php index fdd5610..a4548f8 100644 --- a/database/migrations/2023_10_20_080404_create_pigeon_messages_table.php +++ b/database/migrations/2023_10_20_080404_create_pigeon_messages_table.php @@ -16,7 +16,7 @@ public function up(): void $table->id(); $table->foreignIdFor(News::class)->constrained(); $table->foreignIdFor(Pigeon::class)->constrained()->onDelete('cascade'); - $table->timestamp('arrival_date'); + $table->timestamp('arrival_date')->nullable(); $table->boolean('is_read')->default(false); $table->timestamps(); });