Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Http\Controllers;
- class HomeController extends Controller
- {
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
- {
- $this->middleware('auth');
- }
- /**
- * Show the application dashboard.
- *
- * @return \Illuminate\Http\Response
- */
- public function index()
- {
- $courses = auth()->user()->courses()->with(['course', 'lessons', 'last_completed_lesson'])->withCount(['completed_lessons', 'lessons'])->get();
- return view('home', ['courses' => $courses]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement