fill($request->all()); $topic->user_id = $this->user()->id; $topic->save(); return $this->response->item($topic, new TopicTransformer())->setStatusCode(201); } /** * @param TopicRequest $request * @param Topic $topic * @return \Dingo\Api\Http\Response * @throws \Illuminate\Auth\Access\AuthorizationException */ public function update(TopicRequest $request, Topic $topic) { $this->authorize('update', $topic); $topic->update($request->all()); return $this->response->item($topic, new TopicTransformer()); } }