Files
jobifygarden/app/Http/Controllers/Web/HomeController.php
T

31 lines
794 B
PHP
Raw Normal View History

2026-04-03 01:04:19 +03:00
<?php
namespace App\Http\Controllers\Web;
use App\Http\Controllers\Controller;
use App\Models\JobCategory;
use App\Repositories\JobRepository;
use Illuminate\Http\Request;
class HomeController extends Controller
{
public function __construct(
private JobRepository $jobRepository
) {}
/**
* Display the homepage with featured jobs
*/
public function index()
{
$featuredJobs = $this->jobRepository->getFeaturedJobs(10);
$recentJobs = $this->jobRepository->getRecentJobs(7, 6);
$stats = $this->jobRepository->getStatistics();
$categories = JobCategory::withCount('jobs')
->orderBy('name')
->get();
return view('home', compact('featuredJobs', 'recentJobs', 'stats', 'categories'));
}
}