diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 2a606a5..77307f4 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -39,7 +39,9 @@ class HomeController extends Controller $month_counts = Post::where('user_id', $user_id) ->whereYear('date_post', $today->format('Y')) ->whereMonth('date_post', $today->format('m'))->count(); - $image_counts = 0; // TODO #4 + $image_counts = Post::where('user_id', Auth::user()->getAuthIdentifier()) + ->where('image', '!=', 'null') + ->count(); $posts = Post::where('user_id', $user_id)->orderBy('date_post', 'DESC')->limit(9)->get(); $today_post = Post::whereDate('date_post', '=', $today->format('Y-m-d')) ->where('user_id', $user_id)