56 lines
2.3 KiB
PHP
56 lines
2.3 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\ProfileController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
// Legacy routes are defined in routes/legacy.php and provide the site's
|
|
// legacy pages (art, forum, news, profile, etc.). We keep the auth routes
|
|
// and dashboard as before.
|
|
require __DIR__.'/legacy.php';
|
|
|
|
Route::get('/dashboard', function () {
|
|
return view('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';
|
|
|
|
// Artwork public show (slug-based). This must come before the category route so the artwork
|
|
// slug (last segment) is matched correctly while allowing multi-segment category paths.
|
|
Route::get('/{contentTypeSlug}/{categoryPath}/{artwork}', [\App\Http\Controllers\ArtworkController::class, 'show'])
|
|
->where([
|
|
'contentTypeSlug' => 'photography|wallpapers|skins|other',
|
|
'categoryPath' => '.*',
|
|
'artwork' => '[A-Za-z0-9\-]+'
|
|
])
|
|
->name('artworks.show');
|
|
|
|
// New slug-based category routes (e.g., /photography/audio/winamp)
|
|
Route::get('/{contentTypeSlug}/{categoryPath?}', [\App\Http\Controllers\CategoryPageController::class, 'show'])
|
|
->where('contentTypeSlug', 'photography|wallpapers|skins|other')
|
|
->where('categoryPath', '.*')
|
|
->name('category.slug');
|
|
|
|
use App\Http\Controllers\ManageController;
|
|
|
|
Route::middleware(['auth'])->group(function () {
|
|
Route::get('/manage', [ManageController::class, 'index'])->name('manage');
|
|
Route::get('/manage/edit/{id}', [ManageController::class, 'edit'])->name('manage.edit');
|
|
Route::post('/manage/update/{id}', [ManageController::class, 'update'])->name('manage.update');
|
|
Route::post('/manage/delete/{id}', [ManageController::class, 'destroy'])->name('manage.destroy');
|
|
});
|
|
|
|
// Admin routes for artworks (separated from public routes)
|
|
Route::middleware(['auth'])->prefix('admin')->name('admin.')->group(function () {
|
|
Route::resource('artworks', \App\Http\Controllers\Admin\ArtworkController::class)->except(['show']);
|
|
});
|
|
|
|
|