/** * Display a listing of the resource. * * @return Response */ public function index(Request $request) { $topics = Topic::orderBy('status', 'asc')->orderBy('sorter', 'desc')->get(); if ($request->format() != 'html') { return $topics; } else { return view('topic.index', ['topics' => $topics]); } }
public function menuList(Request $request) { // $classes = Video::distinct()->groupBy('class')->get(); // //$topicsList = Video::distinct()->groupBy('topic')->get(); // //$topicsList = Topic::distinct()->groupBy('course')->orderBy('priority','ASC')->get(); // $topicsList = Video::join('topics',function($join){ // $join->on('videos.topic','=','topics.topic')->On('videos.class','=','topics.course'); // })->groupBy('topics.topic')->orderBy('priority', 'ASC')->get(); // $menuList = Video::get(); // $videos = Video::where('instructor','like', $squery)->orWhere('title', 'like', $squery)->orWhere('class', 'like', $squery)->orderBy('id', 'DESC')->paginate(15); // $data = Video::join('topics',function($join){ // $join->on('videos.class','=','topics.course') ->on('videos.unit','=','topics.unit'); // })->groupBy('topics.course')->orderBy('priority', 'ASC')->get(); $data = Video::orderBy('order', 'ASC')->get(); $classes = Video::distinct()->groupBy('class')->get(); $menuList = Topic::orderBy('priority', 'ASC')->get(); return view('videos.menu', compact('menuList', 'classes', 'data')); //return view('videos.menu', compact('videos'))->with('search', $search); //return view('videos.menu'); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $topics = Topic::orderBy('updated_at', 'desc')->paginate(24); return view('topics.index', compact('topics')); }
public function allChannel() { return view('webboard', ['latestTopic' => 'latest topic', 'topics' => Topic::orderBy('created_at')->paginate(config('app.frontEnd.topic.per_page')), 'channels' => Channel::all(), 'user' => Auth::user()]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($video) { $units = Topic::orderBy('priority', 'ASC')->get(); $topics = Video::distinct()->select(['class', 'topic'])->orderBy('class', 'ASC')->get(); return view('videos.edit', compact('video', 'units', 'topics')); }
/** * Display all topics * @return \Illuminate\View\View */ public function index() { $topics = Topic::orderBy('title', 'asc')->get(); return view('topics.index', compact('topics')); }