add: store unread news notifications

This commit is contained in:
Roardom
2025-06-17 10:41:04 +00:00
parent 99800ce14e
commit 9e63d82297
9 changed files with 177 additions and 37 deletions
+4 -1
View File
@@ -17,6 +17,7 @@ declare(strict_types=1);
namespace App\Http\Controllers;
use App\Models\Article;
use Illuminate\Http\Request;
/**
* @see \Tests\Feature\Http\Controllers\ArticleControllerTest
@@ -36,8 +37,10 @@ class ArticleController extends Controller
/**
* Show A Article.
*/
public function show(Article $article): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
public function show(Request $request, Article $article): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
$article->unreads()->whereBelongsTo($request->user())->delete();
return view('article.show', [
'article' => $article->load(['user', 'comments']),
]);