A Laravel application for managing products with form submission, AJAX functionality, and JSON/XML file storage.
- Add products with name, quantity, and price
- View all products in a table ordered by submission datetime
- Edit existing products
- Automatic calculation of total value (quantity × price)
- Sum total of all product values
- Data persisted in both JSON and XML formats
- AJAX form submission (no page reload)
- Bootstrap-styled UI
- PHP >= 8.2
- Composer
- Node.js and npm (for asset compilation, though Bootstrap is loaded via CDN)
-
Extract the project files
-
Install dependencies:
composer install npm install
-
Copy the environment file:
copy .env.example .env
-
Generate application key:
php artisan key:generate
-
Ensure storage directory is writable:
php artisan storage:link
On Windows, you may need to set permissions on the
storage/appdirectory. -
Start the development server:
php artisan serve
-
Open your browser and navigate to
http://localhost:8000
-
Fill in the form with:
- Product Name
- Quantity in Stock
- Price per Item
-
Click "Submit" to add the product
-
The product will appear in the table below, ordered by submission datetime (newest first)
-
Click "Edit" on any row to modify the product details
-
The "Total Value" is automatically calculated as Quantity × Price
-
The sum of all total values is displayed at the bottom of the table
Product data is saved in:
storage/app/products.json- JSON formatstorage/app/products.xml- XML format
Both files are updated automatically when products are added or edited.
- Laravel 12.x
- PHP 8.2+
- Bootstrap 5.3
- jQuery (for AJAX)
- JSON/XML file storage