mirror of https://github.com/Devoalda/LaDo.git
48 lines
1.4 KiB
PHP
48 lines
1.4 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\ProfileController;
|
|
use Illuminate\Support\Facades\Route;
|
|
use App\Http\Controllers\TodoController;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider and all of them will
|
|
| be assigned to the "web" middleware group. Make something great!
|
|
|
|
|
*/
|
|
|
|
Route::get('/', function () {
|
|
return redirect(route('todo.index'));
|
|
});
|
|
|
|
Route::get('/dashboard', function () {
|
|
return view('dashboard');
|
|
})->middleware(['auth', 'verified'])
|
|
->name('dashboard');
|
|
|
|
// Show dashboard after login, get user data from TodoController
|
|
//Route::get('/dashboard', [TodoController::class, 'index'])
|
|
// ->middleware(['auth', 'verified'])
|
|
// ->name('dashboard');
|
|
|
|
// todo resource route
|
|
Route::resource('todo', TodoController::class)
|
|
->middleware([
|
|
'auth',
|
|
'verified',
|
|
'web'
|
|
]);
|
|
|
|
|
|
Route::middleware('auth')->group(function () {
|
|
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
|
|
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
|
|
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
|
|
});
|
|
|
|
require __DIR__.'/auth.php';
|