flowtodo/routes/web.php
Javier Feliz 0ddd325281
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
Initial commit
2025-07-15 18:28:47 -04:00

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';