/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($category = false)
 {
     if ($category !== false) {
         if ($category == 0) {
             return redirect('announcements/list');
         }
         if (Auth::check() && Auth::user()->level_id > 2) {
             $announcements = Announcement::ofCategory($category)->with('author', 'category', 'comments')->paginate(5);
         } else {
             $announcements = Announcement::where('validated', 1)->ofCategory($category)->with('author', 'category', 'comments')->paginate(5);
         }
     } else {
         if (Auth::check() && Auth::user()->level_id > 2) {
             $announcements = Announcement::with('author', 'category', 'comments')->paginate(5);
         } else {
             $announcements = Announcement::where('validated', 1)->with('author', 'category', 'comments')->paginate(5);
         }
     }
     return view('announcements.index', compact('announcements', 'category'));
 }