Events are the core entity in Eventify. Each event record brings together a name, rich description, cover image, pricing, capacity tracking, a geocoded location, and metadata such as category and status — giving organizers a complete picture of every event they run and giving attendees everything they need to discover and attend.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/astrxnomo/eventify-app/llms.txt
Use this file to discover all available pages before exploring further.
Event Model Fields
Every event is stored in theevents table. The table is defined by the migration below and the corresponding Event Eloquent model.
Auto-incrementing primary key.
Public-facing title of the event.
Full description of the event shown on the event detail page.
Relative storage path to the event’s cover image (e.g.
images/example.jpg). Served via the public disk.Remaining tickets available for purchase. Decremented on each ticket sale.
Running count of tickets sold. Incremented on each ticket sale. Defaults to
0.Ticket price in the application’s base currency unit.
Date and time the event begins.
Date and time the event ends.
Foreign key referencing the
users table. Set to null if the owning user is deleted.Foreign key referencing the
locations table. Set to null if the location is deleted.Foreign key referencing the
categories table. Set to null if the category is deleted.Foreign key referencing the
statuses table. Defaults to 1 (Disponible). Set to null if the status is deleted.Column defined by
$table->softDeletes() in the migration. Note: the Event model does not use the SoftDeletes trait, so this column is not automatically managed by Eloquent.Creating Events
Authenticated users (and admins) create events through the dashboard atGET /dashboard/events/create. The creation form collects the following fields:
| Form Field | Input Name | Description |
|---|---|---|
| Event Name | eventName | Title of the event |
| Description | eventDescription | Full event description |
| Cover Image | eventImage | Image file upload |
| Category | eventCategory | ID from the categories table |
| Capacity | eventCapacity | Total ticket supply |
| Price | eventPrice | Per-ticket price |
| Start Date | eventStartDate | Datetime the event begins |
| End Date | eventEndDate | Datetime the event ends |
| Street Address | eventAddress | Street-level address |
| City | eventCity | City name |
| Region | eventRegion | State, province, or region |
| Country | eventCountry | Country name |
POST /dashboard/events/store, EventController::store() runs the following sequence:
Create the Location record
A new
Location is instantiated and populated with country, city, region, and address from the request.Geocode the address via Nominatim
The controller builds a combined address string (Coordinates are stored on the
address, city) and issues a GET request to the Nominatim OpenStreetMap API using a Guzzle HTTP client:Location record. If the Nominatim lookup returns no results, latitude and longitude are saved as null.Save the Location
$location->save() persists the record and provides the id needed for the foreign key.Build the Event
A new
Event is instantiated and all form fields are assigned, including user_id from auth()->id() and location_id from the saved location.Upload the cover image
If an image was included in the request, it is stored in the
public disk under the images/ directory:Editing Events
Organizers can edit their events viaGET /dashboard/events/edit/{event}, which loads the edit form pre-populated with the existing values. Changes are submitted via PATCH /dashboard/events/{event}, handled by EventController::update().
The update logic handles two important cases:
Image replacement — If a new image file is uploaded, the controller deletes the old image from storage before saving the new one:
Location record. Re-geocoding is triggered only when something has actually changed, avoiding unnecessary API calls:
Event Status
Status is automatically managed by the application and reflects the current availability of an event. The assignment logic is applied both at creation time and during ticket purchases:| Condition | status_id | Label |
|---|---|---|
Created with capacity > 0 | 1 | Disponible |
Created with capacity == 0 | 2 | Agotado |
Last ticket sold (capacity reaches 0) | 2 | Agotado |
| Manually set by admin after the event | 3 | Finalizado |
Deleting Events
Events are deleted viaDELETE /dashboard/events/delete/{event}, handled by EventController::destroy():
events table migration defines a deleted_at column via $table->softDeletes(), but the Event model does not use the SoftDeletes trait. As a result, $event->delete() performs a hard delete — the row is permanently removed from the database. Ticket records and any other data referencing the deleted event’s ID will lose their association.
Explore Page
The public/explore route displays all events to unauthenticated and authenticated visitors alike. Events are ordered from newest to oldest:
/) uses the same ordering logic via showHome(), providing a consistent discovery experience across both surfaces.
PDF Reports
Authenticated users can download a PDF summary of any event by visiting:EventController::downloadEventReport() method loads the reports.event-report Blade view and streams it as a PDF download using the DomPDF library:
event-{id}.pdf. The report view receives the full $event model instance, including its related location, category, status, and ticket data.
The PDF report route is defined outside the
/dashboard prefix group and carries no auth middleware. It is publicly accessible to any visitor who knows or guesses the event ID. If you want to restrict report downloads to authenticated users, add the auth middleware to this route in routes/web.php.Relationships
TheEvent model declares the following Eloquent relationships:
User
The organizer who created the event. Foreign key
user_id; set to null on user deletion.Location
A dedicated
locations record holding address, city, region, country, and geocoded latitude/longitude.Category
One of the seeded categories (Musical, Teatro, Deportivo, etc.) used for filtering and discovery.
Status
Reflects current availability — Disponible, Agotado, or Finalizado.