public function destroyBoard($id)
 {
     return Board::destroy($id);
 }
Пример #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  * name: null,
  */
 public function edit($id)
 {
     $data = array('type' => array('board' => true, 'text' => 'Board'), 'orderTypeModel' => 0, 'orderValue' => null, 'created' => true);
     if (Input::get('category')) {
         $board = Category::find($id);
         $data['type'] = ['board' => false, 'text' => 'Category'];
     } else {
         $board = Board::with('parent')->find($id);
         $data['permissions'] = $board->getDefaultPermissions();
         $data['description'] = $board->description;
     }
     $data['name'] = $board->name;
     Javascript::put('tree', $this->boards->getForumTree());
     Javascript::put('form', $data);
     return view('backend.forums.boards.edit', compact('board'));
 }
Пример #3
0
 public function viewBoard($id)
 {
     $board = Board::findOrFail($id);
     $topics = $board->topics()->with('posts')->get();
     return view('frontend.forums.boards.view', compact('board', 'topics'));
 }