🐛 Corrige un bug en cas de deconnexion et un compteur

This commit is contained in:
2019-10-01 16:21:28 +02:00
parent c23baa8684
commit 6ef79c10dd
2 changed files with 2 additions and 2 deletions

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();