A RESTful E-Commerce API built with Laravel, designed to handle core online store functionalities such as products, categories, users, and orders.
This project serves as a backend API that can be consumed by web or mobile applications.
- Introduction
- Features
- Technology Stack
- Installation
- Environment Configuration
- Database
- API Documentation
- Usage
- Admin Panel
- Project Structure
- Testing
- Troubleshooting
- Contributors
- License
This Laravel E-Commerce API provides backend functionality for an online store.
It exposes RESTful endpoints to manage users, products, categories, and orders, making it suitable for frontend frameworks such as Vue, React, Angular, or mobile apps.
- User authentication
- Product management (CRUD)
- Category management
- Order processing
- RESTful API endpoints
- Database schema included
- Postman collection for API testing
- PHP (Laravel Framework)
- MySQL (or compatible relational database)
- Composer (Dependency Manager)
- Postman (API Testing)
git clone https://github.com/Aking16/laravel-ecommerce-api.git
cd laravel-ecommerce-apicomposer installcp .env.example .envphp artisan key:generateEdit the .env file and configure your database:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_ecommerce
DB_USERNAME=root
DB_PASSWORD=Run migrations to create database tables:
php artisan migrateA visual database schema is provided in the project:
db-schema.png
A Postman collection is included for testing all available endpoints:
postman_collection.json
- Open Postman
- Click Import
- Select
postman_collection.json - Configure your base URL (e.g.
http://127.0.0.1:8000/api)
http://127.0.0.1:8000/docs
Start the Laravel development server:
php artisan serveAPI will be available at:
http://127.0.0.1:8000/api
Create an admin user
php artisan filament:make-userThen login with the created account
http://127.0.01:8000/admin/login
laravel-ecommerce-api/
├── app/ # Application logic
├── database/ # Migrations & seeders
├── routes/ # API routes
├── public/ # Public assets
├── postman_collection.json
├── db-schema.png
└── README.md
If tests are included, you can run them using:
php artisan test- Ensure Composer is installed and up to date
- Verify database credentials in
.env - Run
php artisan config:clearif environment changes aren’t reflected - Make sure required PHP extensions are enabled
- Aking16 – Project Author
Contributions are welcome. Feel free to fork the repository and submit a pull request.
This project is open-source and available under the MIT License.
If you find this project useful, please consider giving it a ⭐ on GitHub.