feat: person tags system - org-level skills with self-reported and organiser-assigned sources
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,29 @@ final class PersonController extends Controller
|
||||
$query->where('status', $request->input('status'));
|
||||
}
|
||||
|
||||
if ($request->filled('tag')) {
|
||||
$organisation = $event->organisation;
|
||||
$query->whereHas('user', function ($q) use ($request, $organisation) {
|
||||
$q->whereHas('organisationTags', function ($q2) use ($request, $organisation) {
|
||||
$q2->where('organisation_id', $organisation->id)
|
||||
->where('person_tag_id', $request->input('tag'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if ($request->filled('tags')) {
|
||||
$organisation = $event->organisation;
|
||||
$tagIds = explode(',', $request->input('tags'));
|
||||
foreach ($tagIds as $tagId) {
|
||||
$query->whereHas('user', function ($q) use ($tagId, $organisation) {
|
||||
$q->whereHas('organisationTags', function ($q2) use ($tagId, $organisation) {
|
||||
$q2->where('organisation_id', $organisation->id)
|
||||
->where('person_tag_id', $tagId);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return new PersonCollection($query->get());
|
||||
}
|
||||
|
||||
@@ -38,7 +61,7 @@ final class PersonController extends Controller
|
||||
{
|
||||
Gate::authorize('view', [$person, $event]);
|
||||
|
||||
$person->load(['crowdType', 'company']);
|
||||
$person->load(['crowdType', 'company', 'user']);
|
||||
|
||||
return $this->success(new PersonResource($person));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user