bus = $bus; } /** * Update a post according to input from the API request, and return it * ready to be serialized and assigned to the JsonApi response. * * @param JsonApiRequest $request * @param Document $document * @return \Illuminate\Database\Eloquent\Collection */ protected function data(JsonApiRequest $request, Document $document) { return $this->bus->dispatch( new EditPost($request->get('id'), $request->actor, $request->get('data')) ); } }