Ejemplo n.º 1
0
 public function showUserInfoAction($id)
 {
     $user = User::where('id', '=', $id)->first();
     $messages = ForumPageMessage::where('user', '=', $user->user_name)->get();
     return view('admin.show_user', ['user' => $user, 'messages' => $messages]);
 }
Ejemplo n.º 2
0
 public function postAddForumTopicAction()
 {
     $user = Auth::user();
     Page::create(array('title' => Input::get('title'), 'parent_id' => Input::get('parent_page_id')));
     $page_id = Page::max('id');
     ForumPageMessage::create(array('page_title' => Input::get('title'), 'content' => Input::get('content'), 'page_id' => $page_id, 'user' => $user->user_name));
     $parent_page = Page::where('id', '=', Input::get('parent_page_id'))->first();
     $parent_page->child_amount++;
     $parent_page->save();
     return redirect('/forum?id=' . $page_id . '&page_number=1');
 }