mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-20 06:11:09 -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:
57
app/Http/Controllers/ParkController.php
Normal file
57
app/Http/Controllers/ParkController.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Park;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class ParkController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of parks.
|
||||
*/
|
||||
public function index(): View
|
||||
{
|
||||
return view('parks.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new park.
|
||||
*/
|
||||
public function create(): View
|
||||
{
|
||||
return view('parks.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified park.
|
||||
*/
|
||||
public function show(Park $park): View
|
||||
{
|
||||
// Load relationships for the park detail page
|
||||
$park->load([
|
||||
'operator',
|
||||
'location',
|
||||
'areas.rides' => function ($query) {
|
||||
$query->orderBy('position')->orderBy('name');
|
||||
},
|
||||
'areas' => function ($query) {
|
||||
$query->orderBy('position')->orderBy('name');
|
||||
},
|
||||
'photos' => function ($query) {
|
||||
$query->orderBy('is_featured', 'desc')->orderBy('created_at', 'desc');
|
||||
}
|
||||
]);
|
||||
|
||||
return view('parks.show', compact('park'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified park.
|
||||
*/
|
||||
public function edit(Park $park): View
|
||||
{
|
||||
return view('parks.edit', compact('park'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user