mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-20 08:31:09 -05:00
- 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.
77 lines
3.7 KiB
PHP
77 lines
3.7 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="container mx-auto px-4 py-8">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">Operators</h1>
|
|
<a href="{{ route('operators.create') }}" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg">
|
|
Add New Operator
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Search and Filters -->
|
|
<form method="GET" class="mb-6">
|
|
<div class="flex gap-4">
|
|
<input type="text" name="search" value="{{ request('search') }}"
|
|
placeholder="Search operators..."
|
|
class="flex-1 px-4 py-2 border border-gray-300 rounded-lg dark:bg-gray-700 dark:border-gray-600 dark:text-white">
|
|
<select name="status" class="px-4 py-2 border border-gray-300 rounded-lg dark:bg-gray-700 dark:border-gray-600 dark:text-white">
|
|
<option value="">All Status</option>
|
|
<option value="active" {{ request('status') === 'active' ? 'selected' : '' }}>Active</option>
|
|
<option value="inactive" {{ request('status') === 'inactive' ? 'selected' : '' }}>Inactive</option>
|
|
</select>
|
|
<button type="submit" class="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-lg">
|
|
Search
|
|
</button>
|
|
</div>
|
|
</form>
|
|
|
|
<!-- Results -->
|
|
<div class="bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden">
|
|
@forelse($operators as $operator)
|
|
<div class="p-6 border-b border-gray-200 dark:border-gray-700">
|
|
<div class="flex justify-between items-start">
|
|
<div>
|
|
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">
|
|
<a href="{{ route('operators.show', $operator) }}" class="hover:text-blue-600">
|
|
{{ $operator->name }}
|
|
</a>
|
|
</h3>
|
|
@if($operator->description)
|
|
<p class="text-gray-600 dark:text-gray-400 mt-2">{{ $operator->description }}</p>
|
|
@endif
|
|
<div class="flex items-center mt-2 space-x-4">
|
|
<span class="text-sm text-gray-500">
|
|
{{ $operator->created_at->format('M j, Y') }}
|
|
</span>
|
|
<span class="px-2 py-1 text-xs rounded-full {{ $operator->is_active ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800' }}">
|
|
{{ $operator->is_active ? 'Active' : 'Inactive' }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="flex space-x-2">
|
|
<a href="{{ route('operators.edit', $operator) }}" class="text-blue-600 hover:text-blue-800">Edit</a>
|
|
<form action="{{ route('operators.destroy', $operator) }}" method="POST" class="inline">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="text-red-600 hover:text-red-800"
|
|
onclick="return confirm('Are you sure?')">Delete</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@empty
|
|
<div class="p-6 text-center text-gray-500 dark:text-gray-400">
|
|
No operators found.
|
|
</div>
|
|
@endforelse
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
@if($operators->hasPages())
|
|
<div class="mt-6">
|
|
{{ $operators->links() }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endsection |