form exclusion specialities done
This commit is contained in:
@@ -65,10 +65,26 @@ class CorporateServiceConfigResource extends JsonResource
|
||||
return $speciality->exclusions->first()->rules->where('name', 'min_age')->first()->values ?? '';
|
||||
});
|
||||
|
||||
$data['exclusions'] = $data['exclusions']->map(function ($item, $key) use ($list_msc, $list_gender, $min_age) {
|
||||
$max_age = $this->specialities->map(function ($speciality) {
|
||||
return $speciality->exclusions->first()->rules->where('name', 'max_age')->first()->values ?? '';
|
||||
});
|
||||
|
||||
$plan = $this->specialities->map(function ($speciality) {
|
||||
return $speciality->exclusions->first()->rules->where('name', 'plan')->first()->values ?? null;
|
||||
});
|
||||
|
||||
$data['exclusions'] = $data['exclusions']->map(function ($item, $key) use (
|
||||
$list_msc,
|
||||
$list_gender,
|
||||
$min_age,
|
||||
$max_age,
|
||||
$plan,
|
||||
) {
|
||||
$item['msc'] = $list_msc[$key];
|
||||
$item['gender'] = $list_gender[$key];
|
||||
$item['min_age'] = $min_age[$key];
|
||||
$item['max_age'] = $max_age[$key];
|
||||
$item['plan'] = $plan[$key];
|
||||
return $item;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user