This commit is contained in:
Doar Mihai
2026-04-03 01:04:19 +03:00
parent 2b930a0636
commit 1cbe5bfe3b
12 changed files with 536 additions and 2 deletions
@@ -0,0 +1,30 @@
<?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'));
}
}