🐛 Corrige un bug en cas de deconnexion et un compteur

This commit is contained in:
cdesmidt 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();

View File

@ -20,7 +20,7 @@
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
<div id="app">
<div>
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">