We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I use 'mergeWhen' twice, it adds a array to the Resource response. Is this meant to work like this?
public function toArray($request) { return [ 'id' => $this->id, 'date' => $this->end_date->format('Y-m-d'), 'start_date' => $this->start_date->format('H:i'), 'end_date' => $this->end_date->format('H:i'), $this->mergeWhen($request->user()->role !== 2, [ 'candidates' => ActivityCandidate::collection($this->activityCandidate) ]), $this->mergeWhen($request->user()->role === 2, [ 'is_accepted2' => $this->activityCandidate()->where('candidate_id', $request->user()->candidate->id)->first()->is_accepted, ]), 'attachment_id' => $this->attachment_id, 'attachment' => '', 'department_id' => $this->department_id, 'label_color' => $this->label_color, 'instructions_general' => $this->instructions_general, 'instructions_transport' => $this->instructions_transport, 'send_notification_client' => $this->send_notification_client, 'send_notification_mail' => $this->send_notification_mail, 'send_notification_app' => $this->send_notification_app, ]; }
outputs:
{ "1": { "data": { "is_accepted2": false } }, "id": 6, "date": "2017-09-09", "start_date": "08:00", "end_date": "19:00", "is_accepted2": false, "attachment": "", "department_id": 2, "label_color": "#e3e4e5", "instructions_general": "sadf", "instructions_transport": "sdf", "send_notification_client": false, "send_notification_mail": false, "send_notification_app": false },
The text was updated successfully, but these errors were encountered:
I don't think this is a bug. Use the forums or the slack channel to solve your issue out (if needed)
Sorry, something went wrong.
Thanks, PR opened at #21127
No branches or pull requests
Description:
When I use 'mergeWhen' twice, it adds a array to the Resource response. Is this meant to work like this?
Steps To Reproduce:
outputs:
The text was updated successfully, but these errors were encountered: