Пример #1
0
 public function index()
 {
     $forums = Forum::where('parent_id', 0)->with('subForums')->orderBy('left_id')->get();
     $forums = array_where($forums, function ($_i, $forum) {
         return $forum->canBeViewedBy(Auth::user());
     });
     return view('forum.forums.index', compact('forums'));
 }
Пример #2
0
 public function index()
 {
     $forums = Forum::where("parent_id", 0)->with("subForums")->orderBy("left_id")->get();
     $forums = array_where($forums, function ($_i, $forum) {
         return $forum->canBeViewedBy(Auth::user());
     });
     return view("forum.forums.index", compact("forums"));
 }
Пример #3
0
 public function index()
 {
     $forums = Forum::where('parent_id', 0)->with('subForums')->orderBy('left_id')->get();
     $forums = $forums->filter(function ($forum) {
         return priv_check('ForumView', $forum)->can();
     });
     return view('forum.forums.index', compact('forums'));
 }