33 lines
1.0 KiB
PHP
33 lines
1.0 KiB
PHP
<?php
|
|
|
|
use App\Livewire\Settings\Appearance;
|
|
use App\Livewire\Settings\Password;
|
|
use App\Livewire\Settings\Profile;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
Route::middleware(['auth'])->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';
|