fix student registration
This commit is contained in:
@@ -11,14 +11,16 @@ use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class EmergencyContactDirectoryService
|
||||
{
|
||||
public function groups(): array
|
||||
public function groups(?array $parentIds = null): array
|
||||
{
|
||||
$parentIds = EmergencyContact::query()
|
||||
->distinct()
|
||||
->pluck('parent_id')
|
||||
->filter(static fn ($id) => (int) $id > 0)
|
||||
->values()
|
||||
->all();
|
||||
$parentIds = !empty($parentIds)
|
||||
? array_values(array_filter(array_map('intval', $parentIds), static fn ($id) => $id > 0))
|
||||
: EmergencyContact::query()
|
||||
->distinct()
|
||||
->pluck('parent_id')
|
||||
->filter(static fn ($id) => (int) $id > 0)
|
||||
->values()
|
||||
->all();
|
||||
|
||||
$groups = [];
|
||||
foreach ($parentIds as $parentId) {
|
||||
|
||||
Reference in New Issue
Block a user