Files
cv4/routes/web.php
2024-12-27 20:43:18 -05:00

37 lines
1.3 KiB
PHP

<?php
use App\Http\Controllers\ComicController;
use App\Http\Controllers\ProfileController;
use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
// Auth protected routes
Route::controller(ComicController::class)->middleware('auth')->name('comics.')->group(function () {
Route::get('/', 'index')->name('index');
Route::get('/comic/{pathword}/{uuid}', 'read')->name('read');
Route::get('/comic/{pathword}', 'chapters')->name('chapters');
Route::get('/tags', 'tags')->name('tags');
// Image
Route::get('/image/{url}', 'image')->name('image');
// Favourites show
Route::get('/favourites', 'favourites')->name('favourites');
// Toggle favourites
Route::post('/favourites', 'postFavourite')->name('postFavourite');
});
Route::get('/dashboard', function () {
return Inertia::render('Dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');
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';