mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-20 09:51:10 -05:00
feat: Implement rides management with CRUD functionality
- Added rides index view with search and filter options. - Created rides show view to display ride details. - Implemented API routes for rides. - Developed authentication routes for user registration, login, and email verification. - Created tests for authentication, email verification, password reset, and user profile management. - Added feature tests for rides and operators, including creation, updating, deletion, and searching. - Implemented soft deletes and caching for rides and operators. - Enhanced manufacturer and operator model tests for various functionalities.
This commit is contained in:
@@ -1,82 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Livewire\Counter;
|
||||
|
||||
Route::get('/', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||||
Route::view('/', 'welcome')->name('home');
|
||||
|
||||
Route::get('/counter', Counter::class);
|
||||
Route::view('dashboard', 'dashboard')
|
||||
->middleware(['auth', 'verified'])
|
||||
->name('dashboard');
|
||||
|
||||
Route::view('profile', 'profile')
|
||||
->middleware(['auth'])
|
||||
->name('profile');
|
||||
|
||||
// Parks routes
|
||||
Route::get('/parks', \App\Livewire\ParkListComponent::class)->name('parks.index');
|
||||
Route::get('/parks/create', function () {
|
||||
return 'Create Park';
|
||||
})->name('parks.create');
|
||||
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');
|
||||
Route::get('/parks', [App\Http\Controllers\ParkController::class, 'index'])->name('parks.index');
|
||||
Route::get('/parks/create', [App\Http\Controllers\ParkController::class, 'create'])->name('parks.create')->middleware('auth');
|
||||
Route::get('/parks/{park:slug}', [App\Http\Controllers\ParkController::class, 'show'])->name('parks.show');
|
||||
Route::get('/parks/{park:slug}/edit', [App\Http\Controllers\ParkController::class, 'edit'])->name('parks.edit')->middleware('auth');
|
||||
|
||||
// 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';
|
||||
return view('placeholder', ['title' => 'Rides', 'message' => 'Rides feature coming soon!']);
|
||||
})->name('rides.index');
|
||||
|
||||
// Auth routes
|
||||
Route::get('/login', function () {
|
||||
return 'Login';
|
||||
})->name('login');
|
||||
Route::get('/search', function () {
|
||||
return view('placeholder', ['title' => 'Search Results', 'message' => 'Search feature coming soon!']);
|
||||
})->name('search');
|
||||
|
||||
Route::get('/register', function () {
|
||||
return 'Register';
|
||||
})->name('register');
|
||||
// Admin placeholder route
|
||||
Route::get('/admin', function () {
|
||||
return view('placeholder', ['title' => 'Admin Panel', 'message' => 'Admin panel coming soon!']);
|
||||
})->middleware(['auth'])->name('admin.index');
|
||||
|
||||
Route::post('/logout', function () {
|
||||
return 'Logout';
|
||||
})->name('logout');
|
||||
|
||||
// Settings routes
|
||||
Route::get('/settings', function () {
|
||||
return 'Settings';
|
||||
})->name('settings');
|
||||
|
||||
// Legal routes
|
||||
// Footer routes
|
||||
Route::get('/terms', function () {
|
||||
return 'Terms';
|
||||
return view('placeholder', ['title' => 'Terms of Service', 'message' => 'Terms of Service page coming soon!']);
|
||||
})->name('terms');
|
||||
|
||||
Route::get('/privacy', function () {
|
||||
return 'Privacy';
|
||||
return view('placeholder', ['title' => 'Privacy Policy', 'message' => 'Privacy Policy page coming soon!']);
|
||||
})->name('privacy');
|
||||
|
||||
// Profile routes
|
||||
Route::get('/profile/{username}', function () {
|
||||
return 'Profile';
|
||||
})->name('profile.show');
|
||||
require __DIR__.'/auth.php';
|
||||
|
||||
// Search route
|
||||
Route::get('/search', \App\Livewire\SearchComponent::class)->name('search');
|
||||
// Categories CRUD routes
|
||||
Route::resource('categories', App\Http\Controllers\CategoryController::class);
|
||||
// Operators CRUD routes
|
||||
Route::resource('operators', App\Http\Controllers\OperatorController::class);
|
||||
// Rides CRUD routes
|
||||
Route::resource('rides', App\Http\Controllers\RideController::class);
|
||||
Reference in New Issue
Block a user