Ejemplo n.º 1
0
 public function show(Request $request, $courseSlug, $slug)
 {
     if ($request->user() and $request->user()->hasRole('student')) {
         $lesson = Lesson::where('slug', $slug)->firstOrFail();
         $courses = Course::where('published', 1)->get();
         return view('lesson.show', compact('lesson', 'courses'));
     } else {
         return redirect('purchase');
     }
     return redirect('login')->withErrors('You must be logged in to view this lesson.');
 }
Ejemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $courses = Course::where('published', 1)->orderBy('id', 'desc')->take(18)->get();
     return view('base.home', compact('courses'));
 }
Ejemplo n.º 3
0
 public function show($slug)
 {
     $course = Course::where('slug', $slug)->firstOrFail();
     $courses = Course::where('published', 1)->get();
     return view('course.show', compact('course', 'courses'));
 }