💄 Modifie l'apparence avec tabler.io

Pour #5
This commit is contained in:
2019-10-01 16:15:50 +02:00
parent b4c9714202
commit c23baa8684
5 changed files with 250 additions and 85 deletions

View File

@@ -32,7 +32,13 @@ class HomeController extends Controller
setlocale(LC_TIME, 'fr_FR.utf8');
$today = new DateTime();
$user_id = Auth::user()->getAuthIdentifier();
$posts = Post::where('user_id', $user_id)->orderBy('date_post', 'DESC')->get();
$all_counts = Post::where('user_id', $user_id)->count();
$year_counts = Post::where('user_id', $user_id)->count();
$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
$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)
->count();
@@ -44,6 +50,10 @@ class HomeController extends Controller
return view('home', [
'already' => $already,
'all_counts' => $all_counts,
'year_counts' => $year_counts,
'month_counts' => $month_counts,
'image_counts' => $image_counts,
'today' => $today,
'posts' => $posts,
]);