The wishlist gives authenticated users a personal space to save products from the catalog for later. Every time a product is added or removed, TechStore Explorer enqueues a confirmation email to the user’s registered address so they always have a record of their changes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Emmanuel-Mtz-777/TechStore-Explorer/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Adding a product
A
POST request to /wishlist/add (web) or POST /api/wishlist (API) triggers WishlistController@addWishlist. The controller validates the incoming product_id, then fetches the full product details from the Platzi Fake Store API (with a timeout of 8 seconds and up to 2 retries). Once the product data is confirmed, it writes a new row to the wishlists table and queues a WishlistAddedMail to the user’s address.Email notifications
Both mail classes implementShouldQueue, meaning they are placed onto the application queue rather than sent synchronously during the HTTP request. This keeps response times fast even if the mail server is temporarily slow.
| Event | Mailable | Subject |
|---|---|---|
| Product added to wishlist | WishlistAddedMail | Producto añadido a favoritos |
| Product removed from wishlist | WishlistDeletedMail | Producto Eliminado de favoritos |
auth()->user()->email. Mail dispatch errors are caught and logged (via Log::error) so a mail failure never surfaces as an HTTP error to the end user.
Wishlist data model
When a product is saved, TechStore Explorer denormalises the relevant product and category fields from the Platzi Fake Store API response directly into thewishlists row. This means wishlist data remains readable even if the external API is temporarily unavailable.
| Column | Type | Description |
|---|---|---|
user_id | foreignId | Owning user (cascades on delete) |
product_id | string | Product ID from the external API |
product_name | string | Product title at time of saving |
product_image | string | First image URL from the API |
product_price | decimal(8,2) | Product price at time of saving |
category_id | string | Category ID from the external API |
category_name | string | Category name at time of saving |
Web routes
All wishlist routes require theauth and verified middleware — users must be logged in and have confirmed their email address.
| Method | Path | Controller action | Name |
|---|---|---|---|
GET | /wishlist | WishlistController@index | wishlist |
POST | /wishlist/add | WishlistController@addWishlist | wishlist.store |
DELETE | /wishlist/remove | WishlistController@removeWishlist | wishlist.destroy |