🐛 Corrige un bug en cas de deconnexion et un compteur

This commit is contained in:
Shikiryu committed 2019-10-01 16:21:28 +02:00
1 parent c23baa8684
commit 6ef79c10dd
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -33,7 +33,7 @@ class HomeController extends Controller
$today = new DateTime();
$user_id = Auth::user()->getAuthIdentifier();
$all_counts = Post::where('user_id', $user_id)->count();
$year_counts = Post::where('user_id', $user_id)->count();
$year_counts = Post::where('user_id', $user_id)->whereYear('date_post', $today->format('Y'))->count();
$month_counts = Post::where('user_id', $user_id)
->whereYear('date_post', $today->format('Y'))
->whereMonth('date_post', $today->format('m'))->count();