Beispiel #1
0
 public function update(UpdateReply $request, $id)
 {
     $reply = Reply::findOrFail($id);
     $mention = new Mention();
     $data = $request->all();
     $reply->body_original = $data['body'];
     $data['body'] = $mention->parse($data['body']);
     $reply->body = markdown($data['body']);
     $reply->save();
     flash()->success('Pranešimas sėkmingai atnaujintas!');
     return redirect()->route('topic.show', [$reply->topic->slug]);
 }
Beispiel #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(UpdateTopic $request, $id)
 {
     $data = $request->all();
     $mention = new Mention();
     //Susitvarkom su Markdown
     $topic = $request->topic;
     $topic->title = $data['title'];
     $topic->body_original = $data['body'];
     $data['body'] = $mention->parse($data['body']);
     $topic->body = markdown($data['body']);
     $topic->type = $data['type'];
     $topic->node_id = $data['node_id'];
     $topic->save();
     flash()->success('Tema sėkmingai atnaujinta!');
     //grazinam useri i sukurta topic'a
     return redirect()->route('topic.show', ['slug' => $topic->slug]);
 }
Beispiel #3
0
 public function commentSave(UpdateStatusComment $request)
 {
     $data = $request->all();
     $mention = new Mention();
     $comment = StatusComment::findOrFail($data['id']);
     $comment->body_original = $data['body'];
     $comment->body = markdown($mention->parse($data['body']));
     $comment->save();
     flash()->success('Komentaras sėkmingai atnaujintas!');
     return redirect()->route('status.show', $comment->status->id);
 }