Add interactive map to visualize candidates provenance using Leaflet

This commit is contained in:
mrKamoo
2026-04-22 16:29:08 +02:00
parent 6f00da6d10
commit d076fd7d7a
6 changed files with 151 additions and 0 deletions

View File

@@ -55,6 +55,27 @@ class CandidateController extends Controller
]);
}
public function map()
{
$candidates = Candidate::with(['user', 'jobPosition'])
->whereNotNull('city')
->where('city', '!=', '')
->get()
->map(function($c) {
return [
'id' => $c->id,
'name' => $c->user->name,
'city' => $c->city,
'job' => $c->jobPosition?->title,
'score' => $c->weighted_score
];
});
return \Inertia\Inertia::render('Admin/Candidates/Map', [
'candidates' => $candidates
]);
}
public function updateOrder(Request $request)
{
$request->validate([
@@ -286,6 +307,8 @@ class CandidateController extends Controller
$this->storeDocument($candidate, $file, $type);
}
public function toggleSelection(Candidate $candidate)
{
$candidate->update([