private function createAction(Collection $data, TicketActionInterface $action) { $data = $data->merge(['user_id' => $data->get('auth_id'), 'type' => 'create']); return $action->create($data->only(['ticket_id', 'user_id', 'type', 'title', 'body', 'source'])->toArray()); }
public function createEditAction(TicketActionInterface $action, array $changes) { //build and merge reason into body $data = $this->data->merge(['type' => 'edit', 'body' => $this->createBody($changes) . "\n" . $this->data->get('reason'), 'user_id' => $this->data->get('auth_id')]); return $action->create($data->only(['type', 'body', 'user_id', 'ticket_id', 'source'])->toArray()); }