Add interactive map to visualize candidates provenance using Leaflet
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user