Exemplo n.º 1
0
 function questionNew(Request $request)
 {
     $text = new Text();
     $text->question_id = $request->question_id;
     $text->description = $request->description;
     $text->user_id = auth()->user()->id;
     $text->save();
     $question = $text->question()->firstOrFail();
     auth()->user()->role_id == 3 ? $question->isResponded = 1 : ($question->isResponded = 0);
     $question->save();
     return $this->showText($request);
 }