Overview
The Product Management module provides comprehensive tools for managing your product catalog. You can create, edit, and delete products, upload product images, track stock levels, and organize products by categories.Key Features
Product CRUD
Complete create, read, update, and delete operations for products
Image Management
Upload, update, and delete product photos with validation
Search & Filter
Real-time product search by code or name
Stock Tracking
Monitor inventory levels and product availability
Product Workflow
Creating a Product
When adding a new product to the system, youβll need to provide:- Category - Assign the product to an existing category
- Product Code - Unique identifier (validated for duplicates)
- Product Name - Descriptive name
- Price - Numeric value
- Stock - Initial inventory quantity
- Description - Optional product details
- Photo - Optional product image (PNG, JPG, JPEG)
Product codes must be unique. The system will prevent duplicate entries and display an error if the code already exists.
Validation Rules
The system enforces strict validation rules when creating or updating products:Duplicate Detection
Before creating a product, the system checks for existing products with the same code:Viewing Products
The product index displays a paginated list of all products with:- Product code and name
- Associated category
- Current price
- Available stock
- Product photo
- Status indicator
Products are displayed 10 per page with automatic pagination controls.
Updating Products
Editing Product Information
You can update all product details except the product ID. The system validates:- Required fields - Category, code, name, price, and stock
- Numeric values - Price and stock must be valid numbers
- Unique codes - Prevents conflicts with other products
Managing Product Images
Upload or Update Product Photo
Upload or Update Product Photo
Upload a new product image or replace an existing one. Images are stored with the format Accepted formats: PNG, JPG, JPEG
{product_id}-{original_filename} in the storage/app/public/FOTO-PRODUCTOS/ directory.Delete Product Photo
Delete Product Photo
Remove a productβs photo while keeping all other product information intact. The photo file is deleted from storage and the database field is cleared.
Search Functionality
The product search feature allows you to quickly find products by:- Product Code - Partial or exact match
- Product Name - Partial or exact match
The search API returns JSON responses and can be integrated into sales processes or inventory checks.
Deleting Products
When deleting a product:- The system verifies the product exists
- Attempts to remove the product record
- Returns success or error feedback
Database Structure
Products are stored with the following key fields:id_producto- Primary keyid_categoria- Foreign key to categorycodigo- Unique product codenombre- Product nameprecio- Product pricestock- Available quantitydescripcion- Product descriptionfoto- Image filenameestado- Product status (1 = active)
Related Features
- Categories - Organize products into categories
- Inventory - Track stock movements and entries