Example #1
0
 /**
  * show topic index page
  *
  * @return Response
  */
 public function index()
 {
     // get topic info
     $today = date('Y-m-d', time());
     $topic = Pic::select('topic', 'id')->whereBetween('created_at', [$today . ' 00:00:01', $today . ' 23:59:59'])->first();
     // get talks
     $hotesttalk = Talks::orderBy('upnum', 'desc')->first();
     $talks = Talks::where('tid', $topic->id)->orderBy('created_at', 'desc')->paginate(20);
     return view('show.topics')->with(compact('topic', 'hotesttalk', 'talks'));
 }
Example #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $pics = Pic::select('id', 'title', 'author', 'content', 'path', 'created_at')->orderBy('created_at', 'desc')->paginate(10);
     return view('admin.pics_index')->with(compact('pics'));
 }