Files
baharrezaei-project09/app/Http/Controllers/Admin/DashboardController.php
T

33 lines
716 B
PHP

<?php
namespace App\Http\Controllers\Admin;
use App\Models\Booking;
use App\Models\Comment;
use App\Models\Flight;
use App\Models\Tour;
use App\Models\User;
use Illuminate\Routing\Controller;
use Illuminate\Support\Carbon;
class DashboardController extends Controller
{
public function index()
{
$bookingsCount = Booking::count();
$flightsCount = Flight::count();
$toursCount = Tour::count();
$commentsCount = Comment::count();
$usersCount = User::count();
return view('admin.dashboard', compact(
'bookingsCount',
'flightsCount',
'toursCount',
'commentsCount',
'usersCount',
));
}
}