mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-20 08:11:10 -05:00
Add photo management features, update database configuration, and enhance park model seeding
This commit is contained in:
@@ -14,13 +14,35 @@ Route::get('/parks', \App\Livewire\ParkListComponent::class)->name('parks.index'
|
||||
Route::get('/parks/create', function () {
|
||||
return 'Create Park';
|
||||
})->name('parks.create');
|
||||
Route::get('/parks/{park}', function () {
|
||||
return 'Show Park';
|
||||
Route::get('/parks/{slug}', function (string $slug) {
|
||||
[$park, $isHistorical] = \App\Models\Park::getBySlug($slug);
|
||||
|
||||
if (!$park) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
// If using a historical slug, redirect to the current slug
|
||||
if ($isHistorical) {
|
||||
return redirect()->route('parks.show', ['slug' => $park->slug]);
|
||||
}
|
||||
|
||||
return view('parks.show', ['park' => $park]);
|
||||
})->name('parks.show');
|
||||
Route::get('/parks/{park}/edit', function () {
|
||||
return 'Edit Park';
|
||||
})->name('parks.edit');
|
||||
|
||||
// Photo routes
|
||||
Route::prefix('parks/{park}/photos')->name('parks.photos.')->group(function () {
|
||||
Route::get('/', [\App\Http\Controllers\PhotoController::class, 'index'])->name('index');
|
||||
Route::post('/', [\App\Http\Controllers\PhotoController::class, 'store'])->name('store');
|
||||
Route::put('/reorder', [\App\Http\Controllers\PhotoController::class, 'reorder'])->name('reorder');
|
||||
Route::get('/{photo}', [\App\Http\Controllers\PhotoController::class, 'show'])->name('show');
|
||||
Route::put('/{photo}', [\App\Http\Controllers\PhotoController::class, 'update'])->name('update');
|
||||
Route::delete('/{photo}', [\App\Http\Controllers\PhotoController::class, 'destroy'])->name('destroy');
|
||||
Route::put('/{photo}/featured', [\App\Http\Controllers\PhotoController::class, 'setFeatured'])->name('featured');
|
||||
});
|
||||
|
||||
// Rides routes
|
||||
Route::get('/rides', function () {
|
||||
return 'Rides Index';
|
||||
|
||||
Reference in New Issue
Block a user