mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-23 01:51:11 -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,12 +1,12 @@
|
||||
<div>
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 mb-6">
|
||||
<div class="bg-white rounded-lg shadow-md p-6 mb-6">
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">Photo Gallery</h3>
|
||||
<h3 class="text-lg font-semibold text-gray-900">Photo Gallery</h3>
|
||||
|
||||
<div class="flex space-x-2">
|
||||
<button
|
||||
wire:click="toggleViewMode"
|
||||
class="inline-flex items-center px-3 py-1.5 bg-gray-100 border border-gray-300 rounded-md font-medium text-xs text-gray-700 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition ease-in-out duration-150 dark:bg-gray-700 dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-600"
|
||||
class="inline-flex items-center px-3 py-1.5 bg-gray-100 border border-gray-300 rounded-md font-medium text-xs text-gray-700 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition ease-in-out duration-150"
|
||||
>
|
||||
@if ($viewMode === 'grid')
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
@@ -31,11 +31,11 @@
|
||||
</svg>
|
||||
</div>
|
||||
@elseif ($error)
|
||||
<div class="bg-red-50 border border-red-200 text-red-800 px-4 py-3 rounded relative dark:bg-red-900 dark:border-red-800 dark:text-red-200" role="alert">
|
||||
<div class="bg-red-50 border border-red-200 text-red-800 px-4 py-3 rounded relative" role="alert">
|
||||
<span class="block sm:inline">{{ $error }}</span>
|
||||
</div>
|
||||
@elseif (count($photos) === 0)
|
||||
<div class="text-center py-12 text-gray-500 dark:text-gray-400">
|
||||
<div class="text-center py-12 text-gray-500">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 mx-auto mb-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
||||
</svg>
|
||||
@@ -48,7 +48,7 @@
|
||||
@foreach ($photos as $photo)
|
||||
<div
|
||||
wire:key="photo-{{ $photo->id }}"
|
||||
class="relative group aspect-square overflow-hidden rounded-lg bg-gray-100 dark:bg-gray-700"
|
||||
class="relative group aspect-square overflow-hidden rounded-lg bg-gray-100"
|
||||
>
|
||||
<img
|
||||
src="{{ $photo->url }}"
|
||||
@@ -117,7 +117,7 @@
|
||||
}"
|
||||
class="relative"
|
||||
>
|
||||
<div class="relative aspect-video overflow-hidden rounded-lg bg-gray-100 dark:bg-gray-700">
|
||||
<div class="relative aspect-video overflow-hidden rounded-lg bg-gray-100">
|
||||
@foreach ($photos as $index => $photo)
|
||||
<div
|
||||
x-show="activeSlide === {{ $index }}"
|
||||
@@ -176,7 +176,7 @@
|
||||
@foreach ($photos as $index => $photo)
|
||||
<button
|
||||
@click="activeSlide = {{ $index }}"
|
||||
:class="{'bg-blue-600': activeSlide === {{ $index }}, 'bg-gray-300 dark:bg-gray-600': activeSlide !== {{ $index }}}"
|
||||
:class="{'bg-blue-600': activeSlide === {{ $index }}, 'bg-gray-300': activeSlide !== {{ $index }}}"
|
||||
class="w-2.5 h-2.5 rounded-full transition-colors duration-200"
|
||||
></button>
|
||||
@endforeach
|
||||
@@ -197,11 +197,11 @@
|
||||
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-900 bg-opacity-75 transition-opacity" wire:click="closePhotoDetail"></div>
|
||||
|
||||
<div class="inline-block align-bottom bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-4xl sm:w-full">
|
||||
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-4xl sm:w-full">
|
||||
<div class="absolute top-0 right-0 pt-4 pr-4">
|
||||
<button
|
||||
wire:click="closePhotoDetail"
|
||||
class="bg-white dark:bg-gray-800 rounded-md text-gray-400 hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
class="bg-white rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<span class="sr-only">Close</span>
|
||||
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
@@ -213,7 +213,7 @@
|
||||
<div class="p-6">
|
||||
<div class="flex flex-col md:flex-row gap-6">
|
||||
<div class="md:w-2/3">
|
||||
<div class="aspect-video bg-gray-100 dark:bg-gray-700 rounded-lg overflow-hidden">
|
||||
<div class="aspect-video bg-gray-100 rounded-lg overflow-hidden">
|
||||
<img
|
||||
src="{{ $selectedPhoto->url }}"
|
||||
alt="{{ $selectedPhoto->alt_text ?? $selectedPhoto->title ?? 'Park photo' }}"
|
||||
@@ -223,29 +223,29 @@
|
||||
</div>
|
||||
|
||||
<div class="md:w-1/3">
|
||||
<h3 class="text-lg font-medium text-gray-900 dark:text-white">
|
||||
<h3 class="text-lg font-medium text-gray-900">
|
||||
{{ $selectedPhoto->title ?? 'Untitled Photo' }}
|
||||
</h3>
|
||||
|
||||
@if ($selectedPhoto->description)
|
||||
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
<p class="mt-2 text-sm text-gray-500">
|
||||
{{ $selectedPhoto->description }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<div class="mt-4 border-t border-gray-200 dark:border-gray-700 pt-4">
|
||||
<div class="mt-4 border-t border-gray-200 pt-4">
|
||||
<dl class="space-y-3 text-sm">
|
||||
@if ($selectedPhoto->credit)
|
||||
<div>
|
||||
<dt class="font-medium text-gray-500 dark:text-gray-400">Credit:</dt>
|
||||
<dd class="mt-1 text-gray-900 dark:text-white">{{ $selectedPhoto->credit }}</dd>
|
||||
<dt class="font-medium text-gray-500">Credit:</dt>
|
||||
<dd class="mt-1 text-gray-900">{{ $selectedPhoto->credit }}</dd>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($selectedPhoto->source_url)
|
||||
<div>
|
||||
<dt class="font-medium text-gray-500 dark:text-gray-400">Source:</dt>
|
||||
<dd class="mt-1 text-blue-600 dark:text-blue-400">
|
||||
<dt class="font-medium text-gray-500">Source:</dt>
|
||||
<dd class="mt-1 text-blue-600">
|
||||
<a href="{{ $selectedPhoto->source_url }}" target="_blank" rel="noopener noreferrer" class="hover:underline">
|
||||
{{ $selectedPhoto->source_url }}
|
||||
</a>
|
||||
@@ -254,13 +254,13 @@
|
||||
@endif
|
||||
|
||||
<div>
|
||||
<dt class="font-medium text-gray-500 dark:text-gray-400">Dimensions:</dt>
|
||||
<dd class="mt-1 text-gray-900 dark:text-white">{{ $selectedPhoto->width }} × {{ $selectedPhoto->height }}</dd>
|
||||
<dt class="font-medium text-gray-500">Dimensions:</dt>
|
||||
<dd class="mt-1 text-gray-900">{{ $selectedPhoto->width }} × {{ $selectedPhoto->height }}</dd>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<dt class="font-medium text-gray-500 dark:text-gray-400">File Size:</dt>
|
||||
<dd class="mt-1 text-gray-900 dark:text-white">{{ number_format($selectedPhoto->file_size / 1024, 2) }} KB</dd>
|
||||
<dt class="font-medium text-gray-500">File Size:</dt>
|
||||
<dd class="mt-1 text-gray-900">{{ number_format($selectedPhoto->file_size / 1024, 2) }} KB</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -269,7 +269,7 @@
|
||||
@if (!$selectedPhoto->is_featured)
|
||||
<button
|
||||
wire:click="setFeatured({{ $selectedPhoto->id }})"
|
||||
class="inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:bg-gray-600"
|
||||
class="inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" />
|
||||
@@ -281,7 +281,7 @@
|
||||
<button
|
||||
wire:click="deletePhoto({{ $selectedPhoto->id }})"
|
||||
wire:confirm="Are you sure you want to delete this photo? This action cannot be undone."
|
||||
class="inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:bg-gray-600"
|
||||
class="inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
||||
|
||||
Reference in New Issue
Block a user