git add .

git commit "feat: add last 10 days visits chart to dashboard"
This commit is contained in:
2026-08-19 15:29:11 +03:30
parent 4d8839e802
commit 50bb856b24
6 changed files with 126 additions and 61 deletions
@@ -3,6 +3,7 @@
namespace App\Http\Controllers\Admin\Auth;
use App\Http\Controllers\Controller;
use App\Models\ActivityLog;
use App\Models\Admin;
use App\Models\Flight;
use App\Models\Tour;
@@ -21,15 +22,20 @@ class DashboardController extends Controller
$flightsCount = Flight::count();
$tourViews= Tour::query()
->selectRaw('DATE(create_at) as date,SUM(views) as total')
->selectRaw('DATE(created_at) as date,SUM(views) as total')
->where('created_at','>=',now()->subDays(9))
->qroupBy('date')
->groupBy('date')
->orderBy('date')
->get();
$logs = ActivityLog::with('admin')
->latest()
->take(5)
->get();
return view('admin.dashboard',compact('adminsCount',
'usersCount','toursCount','flightsCount','tourViews'
,'logs'
));
}
}