Skip to content

Commit 881968d

Browse files
committed
✨ Page d'accueil du dashboard
1 parent c2ff2db commit 881968d

File tree

2 files changed

+48
-42
lines changed

2 files changed

+48
-42
lines changed

app/Http/Controllers/Cpanel/DashboardController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DashboardController extends Controller
1111
{
1212
public function home()
1313
{
14-
$users = Cache::remember('new-members', now()->addHour(), fn () => User::verifiedUsers()->latest()->limit(10)->get());
14+
$users = Cache::remember('new-members', now()->addHour(), fn () => User::verifiedUsers()->latest()->limit(15)->get());
1515
$latestArticles = Cache::remember('last-posts', now()->addHour(), fn () => Article::latest()->limit(2)->get());
1616

1717
return view('cpanel.dashboard', [

resources/views/cpanel/dashboard.blade.php

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,58 @@
33
<div>
44
<h3 class="text-3xl leading-8 font-medium text-skin-inverted">{{ __('Shalom, :name', ['name' => auth()->user()->name]) }}</h3>
55
<div class="mt-6 lg:grid lg:grid-cols-5 lg:gap-8">
6-
<div class="lg:col-span-4"></div>
7-
<div class="mt-10 lg:mt-0 lg:col-span-1">
8-
9-
</div>
10-
</div>
11-
</div>
12-
<div class="mt-8">
13-
<div class="pb-5 border-b border-skin-base">
14-
<h3 class="text-lg leading-6 font-medium text-skin-inverted">{{ __('Créer un nouveau contenu') }}</h3>
15-
</div>
16-
<div class="mt-6 lg:grid lg:grid-cols-5 lg:gap-8">
17-
<div class="space-y-8 lg:col-span-4">
18-
<div class="grid gap-5 sm:grid-cols-2 sm:gap-6">
19-
<a href="{{ route('discussions.new') }}" class="group flex p-5 border border-skin-base rounded-md bg-skin-card hover:border-green-300">
20-
<span class="inline-flex items-center justify-center bg-green-50 text-green-800 h-10 w-10 rounded-full">
21-
<svg class="h-5 w-5" fill="none" viewBox="0 0 24 24">
22-
<path d="M8 7h8m-4 0v10m-4.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
23-
</svg>
24-
</span>
25-
<div class="ml-3">
26-
<p class="text-base leading-6 font-medium text-skin-inverted-muted group-hover:text-green-600">{{ __('Démarrer une discussion') }}</p>
27-
<p class="mt-0.5 text-sm leading-5 text-skin-muted">{{ __('Partager des sujets qui animent la communauté.') }}</p>
28-
</div>
29-
</a>
30-
<a href="{{ route('articles.new') }}" class="group flex p-5 border border-skin-base rounded-md bg-skin-card hover:border-green-300">
31-
<span class="inline-flex items-center justify-center bg-green-50 text-green-800 h-10 w-10 rounded-full">
32-
<x-heroicon-o-newspaper class="h-5 w-5" />
33-
</span>
34-
<div class="ml-3">
35-
<p class="text-base leading-6 font-medium text-skin-inverted-muted group-hover:text-green-600">{{ __('Créer un nouvel article') }}</p>
36-
<p class="mt-0.5 text-sm leading-5 text-skin-muted">{{ __('Donnez des informations à propos de Laravel, etc.') }}</p>
37-
</div>
38-
</a>
39-
</div>
40-
<div>
6+
<div class="lg:col-span-4">
7+
@widget('recentNumbers')
8+
<div class="mt-8">
419
<div class="pb-5 border-b border-skin-base">
42-
<h3 class="text-lg leading-6 font-medium text-skin-inverted">{{ __('Derniers articles') }}</h3>
10+
<h3 class="text-lg leading-6 font-medium text-skin-inverted">{{ __('Actions rapide') }}</h3>
4311
</div>
44-
<div class="mt-6 grid gap-5 sm:grid-cols-2 sm:gap-6">
45-
@foreach($latestArticles as $article)
46-
<x-admin.recent-post :article="$article" />
47-
@endforeach
12+
<div class="mt-6 space-y-8">
13+
<div class="grid gap-5 sm:grid-cols-3 sm:gap-6">
14+
<a href="{{ route('discussions.new') }}" class="group flex p-4 border border-skin-base rounded-md bg-skin-card hover:border-green-300">
15+
<div class="flex shrink-0 items-center justify-center bg-green-50 text-green-800 h-10 w-10 rounded-full">
16+
<svg class="h-5 w-5" fill="none" viewBox="0 0 24 24">
17+
<path d="M8 7h8m-4 0v10m-4.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
18+
</svg>
19+
</div>
20+
<div class="ml-3">
21+
<p class="text-sm leading-6 font-medium text-skin-inverted-muted group-hover:text-green-600">{{ __('Démarrer une discussion') }}</p>
22+
<p class="mt-0.5 text-sm leading-5 text-skin-muted">{{ __('Partager des sujets qui animent la communauté.') }}</p>
23+
</div>
24+
</a>
25+
<a href="{{ route('articles.new') }}" class="group flex p-4 border border-skin-base rounded-md bg-skin-card hover:border-green-300">
26+
<div class="flex shrink-0 items-center justify-center bg-green-50 text-green-800 h-10 w-10 rounded-full">
27+
<x-heroicon-o-newspaper class="h-5 w-5" />
28+
</div>
29+
<div class="ml-3">
30+
<p class="text-sm leading-6 font-medium text-skin-inverted-muted group-hover:text-green-600">{{ __('Créer un nouvel article') }}</p>
31+
<p class="mt-0.5 text-sm leading-5 text-skin-muted">{{ __('Donnez des informations à propos de Laravel, etc.') }}</p>
32+
</div>
33+
</a>
34+
<a href="#" class="group flex p-4 border border-skin-base rounded-md bg-skin-card hover:border-green-300">
35+
<div class="shrink-0 flex items-center justify-center bg-green-50 text-green-800 h-10 w-10 rounded-full">
36+
<x-heroicon-o-video-camera class="h-5 w-5" />
37+
</div>
38+
<div class="ml-3">
39+
<p class="text-sm leading-6 font-medium text-skin-inverted-muted group-hover:text-green-600">{{ __('Nouveau tutoriel') }}</p>
40+
<p class="mt-0.5 text-sm leading-5 text-skin-muted">{{ __('Créer un nouveau contenu vidéo pour YouTube.') }}</p>
41+
</div>
42+
</a>
43+
</div>
44+
<div>
45+
<div class="pb-5 border-b border-skin-base">
46+
<h3 class="text-lg leading-6 font-medium text-skin-inverted">{{ __('Derniers articles') }}</h3>
47+
</div>
48+
<div class="mt-6 grid gap-5 sm:grid-cols-2 sm:gap-6">
49+
@foreach($latestArticles as $article)
50+
<x-admin.recent-post :article="$article" />
51+
@endforeach
52+
</div>
53+
</div>
4854
</div>
4955
</div>
5056
</div>
51-
<div class="lg:col-span-1">
57+
<div class="mt-10 lg:mt-0 lg:col-span-1">
5258
<h5 class="text-sm leading-5 text-skin-base font-medium">{{ __('Nouveaux membres') }}</h5>
5359
<div class="mt-6 space-y-5">
5460
@foreach($users as $user)

0 commit comments

Comments
 (0)