-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from Crudzaso/feature/1869/create-cruds
Feature/1869/create cruds
- Loading branch information
Showing
59 changed files
with
1,791 additions
and
358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// resources/assets/js/app.js | ||
import 'tailwindcss/tailwind.css'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@extends('draws::layouts.master') | ||
|
||
@section('content') | ||
<div class="container mx-auto px-6 py-10"> | ||
<h1 class="text-3xl font-extrabold text-gray-800 mb-6">Crear Sorteo</h1> | ||
<form action="{{ route('draws.store') }}" method="POST" class="bg-white shadow-lg rounded-lg p-6"> | ||
@csrf | ||
<div class="mb-4"> | ||
<label class="block text-gray-700">Lotería</label> | ||
<select name="lottery_id" class="w-full px-4 py-2 rounded-lg border"> | ||
@foreach($lotteries as $lottery) | ||
<option value="{{ $lottery->id }}">{{ $lottery->name }}</option> | ||
@endforeach | ||
</select> | ||
</div> | ||
<div class="mb-4"> | ||
<label class="block text-gray-700">Fecha del Sorteo</label> | ||
<input type="datetime-local" name="draw_date" class="w-full px-4 py-2 rounded-lg border"> | ||
</div> | ||
<div class="mb-4"> | ||
<label class="block text-gray-700">Números Ganadores</label> | ||
<input type="text" name="winning_numbers" placeholder="Ejemplo: 12, 34, 56" class="w-full px-4 py-2 rounded-lg border"> | ||
</div> | ||
<button type="submit" class="px-6 py-2 bg-blue-600 text-white rounded-lg">Guardar</button> | ||
</form> | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@extends('draws::layouts.master') | ||
|
||
@section('content') | ||
<div class="container mx-auto px-6 py-10"> | ||
<h1 class="text-3xl font-extrabold text-gray-800 mb-6">Editar Sorteo</h1> | ||
<form action="{{ route('draws.update', $draw->id) }}" method="POST" class="bg-white shadow-lg rounded-lg p-6"> | ||
@csrf | ||
@method('PUT') | ||
<div class="mb-4"> | ||
<label class="block text-gray-700">Lotería</label> | ||
<select name="lottery_id" class="w-full px-4 py-2 rounded-lg border"> | ||
@foreach($lotteries as $lottery) | ||
<option value="{{ $lottery->id }}" {{ $draw->lottery_id == $lottery->id ? 'selected' : '' }}>{{ $lottery->name }}</option> | ||
@endforeach | ||
</select> | ||
</div> | ||
<div class="mb-4"> | ||
<label class="block text-gray-700">Fecha del Sorteo</label> | ||
<input type="datetime-local" name="draw_date" value="{{ $draw->draw_date }}" class="w-full px-4 py-2 rounded-lg border"> | ||
</div> | ||
<div class="mb-4"> | ||
<label class="block text-gray-700">Números Ganadores</label> | ||
<input type="text" name="winning_numbers" value="{{ $draw->winning_numbers }}" class="w-full px-4 py-2 rounded-lg border"> | ||
</div> | ||
<button type="submit" class="px-6 py-2 bg-blue-600 text-white rounded-lg">Actualizar</button> | ||
</form> | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,74 @@ | ||
@extends('draws::layouts.master') | ||
|
||
@section('content') | ||
<h1>Hello World</h1> | ||
<div class="container mx-auto px-6 py-10"> | ||
<!-- Encabezado --> | ||
<div class="flex justify-between items-center mb-8"> | ||
<h1 class="text-3xl font-extrabold text-gray-800">Gestión de Sorteos</h1> | ||
<a href="{{ route('draws.create') }}" class="px-6 py-2 bg-green-600 text-white font-semibold rounded-lg shadow-md hover:bg-green-700"> | ||
Nuevo Sorteo | ||
</a> | ||
</div> | ||
|
||
<p>Module: {!! config('draws.name') !!}</p> | ||
<!-- Tabla de Sorteos --> | ||
<div class="bg-white shadow-lg rounded-lg overflow-hidden"> | ||
<table class="min-w-full divide-y divide-gray-200"> | ||
<thead class="bg-blue-50"> | ||
<tr> | ||
<th class="px-6 py-3 text-left text-xs font-bold text-gray-600 uppercase">Lotería</th> | ||
<th class="px-6 py-3 text-left text-xs font-bold text-gray-600 uppercase">Fecha</th> | ||
<th class="px-6 py-3 text-left text-xs font-bold text-gray-600 uppercase">Números Ganadores</th> | ||
<th class="px-6 py-3 text-left text-xs font-bold text-gray-600 uppercase">Acciones</th> | ||
</tr> | ||
</thead> | ||
<tbody class="bg-white divide-y divide-gray-200"> | ||
@forelse ($draws as $draw) | ||
<tr class="hover:bg-gray-100"> | ||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">{{ $draw->lottery->name }}</td> | ||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">{{ $draw->draw_date }}</td> | ||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">{{ $draw->winning_numbers ?? 'N/A' }}</td> | ||
<td class="px-6 py-4 whitespace-nowrap flex gap-3"> | ||
<!-- Botón Editar --> | ||
<a href="{{ route('draws.edit', $draw->id) }}" class="px-4 py-2 bg-yellow-500 text-white rounded-lg hover:bg-yellow-600"> | ||
Editar | ||
</a> | ||
<!-- Botón Eliminar --> | ||
<form action="{{ route('draws.destroy', $draw->id) }}" method="POST" onsubmit="return confirm('¿Estás seguro de eliminar este sorteo?');"> | ||
@csrf | ||
@method('DELETE') | ||
<button type="submit" class="px-4 py-2 bg-red-600 text-white text-sm font-semibold rounded-lg shadow hover:bg-red-700"> | ||
Eliminar | ||
</button> | ||
</form> | ||
</td> | ||
</tr> | ||
@empty | ||
<tr> | ||
<td colspan="4" class="px-6 py-4 text-center text-sm text-gray-600">No hay sorteos registrados.</td> | ||
</tr> | ||
@endforelse | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<!-- Paginación --> | ||
<div class="flex justify-between items-center mt-6"> | ||
<p class="text-sm text-gray-600"> | ||
Mostrando página {{ $draws->currentPage() }} de {{ $draws->lastPage() }}. | ||
</p> | ||
<div class="flex gap-2"> | ||
@if ($draws->onFirstPage()) | ||
<span class="px-4 py-2 bg-gray-300 text-gray-700 rounded-lg shadow cursor-not-allowed">Anterior</span> | ||
@else | ||
<a href="{{ $draws->previousPageUrl() }}" class="px-4 py-2 bg-gray-300 text-gray-700 rounded-lg shadow hover:bg-gray-400">Anterior</a> | ||
@endif | ||
|
||
@if ($draws->hasMorePages()) | ||
<a href="{{ $draws->nextPageUrl() }}" class="px-4 py-2 bg-gray-300 text-gray-700 rounded-lg shadow hover:bg-gray-400">Siguiente</a> | ||
@else | ||
<span class="px-4 py-2 bg-gray-300 text-gray-700 rounded-lg shadow cursor-not-allowed">Siguiente</span> | ||
@endif | ||
</div> | ||
</div> | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import 'tailwindcss/tailwind.css'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@extends('lotery::layouts.master') | ||
|
||
@section('content') | ||
<div class="container mx-auto px-6 py-10"> | ||
<h1 class="text-3xl font-extrabold text-gray-800 mb-6">Crear Nueva Lotería</h1> | ||
<form action="{{ route('lotery.store') }}" method="POST" class="space-y-6"> | ||
@csrf | ||
<div> | ||
<label class="block text-sm font-medium text-gray-700">Nombre</label> | ||
<input type="text" name="name" class="w-full px-4 py-2 border rounded-lg" required> | ||
</div> | ||
<div> | ||
<label class="block text-sm font-medium text-gray-700">Descripción</label> | ||
<textarea name="description" class="w-full px-4 py-2 border rounded-lg"></textarea> | ||
</div> | ||
<div> | ||
<label class="block text-sm font-medium text-gray-700">URL de la Imagen</label> | ||
<input type="url" name="image_url" class="w-full px-4 py-2 border rounded-lg"> | ||
</div> | ||
<button type="submit" class="px-6 py-2 bg-blue-600 text-white rounded-lg">Guardar</button> | ||
</form> | ||
</div> | ||
@endsection |
Oops, something went wrong.