feat: make dashboard and sidebar dynamic

This commit is contained in:
2026-08-18 19:49:19 +03:30
parent 8fa9a17ead
commit 0ecdf52c29
5 changed files with 287 additions and 214 deletions
+87
View File
@@ -0,0 +1,87 @@
@extends('dashboard.layouts.app')
@section('title' , 'داشبورد')
@section('account-content')
<div class="user-profile-wrapper">
<div class="row">
<div class="col-md-6 col-lg-4">
<div class="dashboard-widget dashboard-widget-color-1">
<div class="dashboard-widget-info">
<h1>{{$totalUser}} عدد</h1>
<span>تمام کاربر ها</span>
</div>
<div class="dashboard-widget-icon">
<i class="far fa-users"></i>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="dashboard-widget dashboard-widget-color-2">
<div class="dashboard-widget-info">
<h1>{{$totalTours}} عدد </h1>
<span>تعداد تور</span>
</div>
<div class="dashboard-widget-icon">
<i class="fal fa-loader"></i>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="dashboard-widget dashboard-widget-color-3">
<div class="dashboard-widget-info">
<h1>{{$totalFlights}} عدد</h1>
<span>تعداد پرواز ها</span>
</div>
<div class="dashboard-widget-icon">
<i class="fal fa-sack-dollar"></i>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="user-profile-card profile-booking">
<h4 class="user-profile-card-title">نظرات اخیر</h4>
<div class="table-responsive">
<table class="table text-nowrap">
<thead>
<tr>
<th>نه</th>
<th>کاربر</th>
<th>نظر</th>
<th>مربوط به</th>
<th>تاریخ</th>
</tr>
</thead>
<tbody>
@forelse($recentComments as $index => $comment)
<tr>
<td>{{ $recentComments->firstItem() + $index }}.</td>
<td>{{ $comment->user->first_name ?? $comment->guest_name }}</td>
<td>{{ \Illuminate\Support\Str::limit($comment->body, 40) }}</td>
<td>{{ $comment->commentable->title ?? $comment->commentable->flight_number ?? '-' }}</td>
<td>{{ $comment->created_at->diffForHumans() }}</td>
</tr>
@empty
<tr>
<td colspan="5" class="text-center">هنوز نظری ثبت نشده.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div class="pagination-area my-4">
{{ $recentComments->links() }}
</div>
</div>
</div>
</div>
</div>
</div>
@endsection