Once you have found an event you want to attend, Boletilandia walks you through an interactive seat-selection experience before confirming your purchase. An SVG venue map lets you click individual seats, review the price and visibility rating, and submit your order — all without leaving the browser.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AndresLopezCorrales/Boletilandia/llms.txt
Use this file to discover all available pages before exploring further.
Starting a Purchase
From the event detail page (/home-pagina_eventos/{evento}), click the Comprar button. This submits a hidden form via:
user middleware and is handled by BoletoController::mostrarPantallaBoletos(). The controller fetches all sections for the event together with their associated seats and passes both to the seat-selection view:
The SVG Seat Map
The seat-selection page (home.seleccionboleto_eventos) renders an inline SVG diagram of the venue. The venue is divided into eight sections arranged in two zones relative to the stage at the bottom of the map:
Front Sections (A–D) — $1,000 per seat
| Section | Seats | Visibility |
|---|---|---|
| A | 8 | Excelente |
| B | 8 | Muy Buena |
| C | 8 | Buena |
| D | 8 | Buena |
Back Sections (E–H) — $500 per seat
| Section | Seats | Visibility |
|---|---|---|
| E | 10 | buena |
| F | 10 | lejos |
| G | 10 | lejos |
| H | 10 | Muy lejos |
<a> element wrapping a <circle>. The element carries all necessary booking data as custom xlink: attributes:
How Seat Data Reaches JavaScript
The Blade template injects the event record and all loaded sections into a global JavaScript object so that client-side scripts can cross-reference database state without additional HTTP requests:get-attributes.js reads window.eventoData.secciones on DOMContentLoaded. For every asiento record found inside a section, the script locates the matching SVG <circle> element using the xlink:data-asiento and xlink:data-seccion attributes and adds the desactivado CSS class, visually marking already-purchased seats. Seats not found in the database carry no extra class.
Selecting a Seat and the Info Panel
When you click any seat circle,get-attributes.js reads the seat’s xlink:data-seccion, xlink:data-asiento, xlink:data-precio, and xlink:data-visi attributes, turns the selected seat green, and dynamically populates the info panel on the right side of the page (#mostrarInfoAsiento). The panel displays:
- Asiento — combined section letter and seat number (e.g.,
A1) - Sección — the section letter
- Precio — price in pesos (e.g.,
$1000) - Visibilidad — the human-readable visibility description from
xlink:data-visi - A Comprar button (
#comprarBtn) carrying the seat’s data as plaindata-*attributes
Occupied seats are visually distinguished by the
desactivado CSS class applied on page load, but clicking any seat — occupied or not — will still populate the info panel and show the Comprar button. The server-side duplicate check in comprarAsiento() is the authoritative guard against double-booking.Submitting the Purchase
Clicking Comprar in the info panel triggerscomprar-boleto.js, which reads the seat data from the button’s plain data-* attributes and dynamically builds and submits a hidden HTML form to:
<meta name="csrf-token"> tag. The fields submitted are:
Server-Side Validation
BoletoController::comprarAsiento() validates all five fields before proceeding:
Duplicate Seat Check
After validation, the controller usesSeccion::firstOrCreate() to ensure the section row exists for the event, then checks whether a matching Asiento record with disponibilidad_asiento = 0 already exists:
/home with no error message. The user must select a different seat.
On Successful Purchase
When the seat is available, the controller creates anAsiento record with disponibilidad_asiento = 0 (occupied), stores three session keys, and redirects to /home with a flash message:
SweetAlert2 Confirmation Popup
On the/home redirect, the Blade template checks for both the message and evento_id session values. If both are present, a SweetAlert2 success dialog appears:
- Title:
Comprado! - Text:
Boleto Comprado. Descarga tu boleto dando 'OK' - Icon: success (green checkmark)
GET form in JavaScript and submits it to /pdf-boleto/{evento_id} to generate and download your PDF ticket. See Downloading Tickets for what happens next.