group(function () { Route::get('/', function () { // Return either the home list or a random list return view('dashboard', [ 'list' => Auth::user()->taskLists()->with('tasks')->orderBy('is_home', 'desc')->first() ]); })->name('dashboard'); Route::get('{slug}', function (string $slug) { $list = Auth::user() ->taskLists() ->with('tasks') ->where('slug', $slug) ->firstOrFail(); return view('dashboard', [ 'list' => $list ]); })->name('list.view'); Route::redirect('settings', 'settings/profile'); Route::get('settings/profile', Profile::class)->name('settings.profile'); Route::get('settings/password', Password::class)->name('settings.password'); }); require __DIR__ . '/auth.php';