Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(TopicRequest $request)
 {
     $topic = new Topic();
     $topic->title = $request->input('title');
     $topic->content = $request->input('content');
     $topic->user_id = $request->user()->id;
     $topic->save();
     return Redirect::action('TopicController@index');
 }
Ejemplo n.º 2
0
 public function store(TopicRequest $request)
 {
     $topic = new Topic();
     $topic->create($request->all());
     return redirect()->action('WebBoardController@allChannel');
 }
Ejemplo n.º 3
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($idForum, $id, TopicRequest $request)
 {
     //
     $topic = ForumTopic::findOrFail($id);
     $topic->setTitre($request->input('topic_titre'));
     $topic->setGenreId($request->input('topic_genre'));
     $topic->save();
     return redirect('forum/' . $idForum . '/topic');
 }