예제 #1
0
 /**
  *
  *
  */
 public function welcome()
 {
     $topic = new \App\Topic();
     $topics = $topic->recentlyCreated();
     $categories = new \App\Categories();
     $categories = $categories->all();
     //If user then check if they have confirmed email and username
     if (Auth::user()) {
         //if email is not confirm
         if (Auth::user()->confirmed == 0) {
             return redirect('/verification');
         }
         //if displayname is not set
         if (empty(Auth::user()->displayname)) {
             return redirect()->action('ProfileController@createName');
         }
     }
     $storage = Redis::connection();
     $mostView = $storage->zRevRange('postViews', 0, 1);
     foreach ($mostView as $value) {
         $id = str_replace('post:', '', $value);
         //            echo "<br> post". $id;
     }
     return view('welcome', compact('topics', 'categories'));
 }