예제 #1
0
 public function courses()
 {
     $productTag = Input::get('tag');
     return view('home.courses.index', ['courses' => $productTag != null ? Course::whereHas('productTags', function ($query) use($productTag) {
         $query->where('name', $productTag);
     })->get() : Course::all()]);
 }
예제 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return view('admin.courses.index', ['courses' => Course::all()]);
 }