A REST API for e-commerce applications built with PHP and Laravel 10.
The API provides product and address management, user authentication and protected endpoints using Laravel Sanctum.
- PHP 8.1+
- Laravel 10
- MySQL
- Laravel Sanctum
- Laravel Fortify
- Composer
- User authentication
- Product management
- Address management
- Protected API routes
- Product categories and variations
- MySQL persistence
GET /api/products
GET /api/products/{id}
POST /api/products
PUT /api/products/{id}
DELETE /api/products/{id}GET /api/address
GET /api/address/{id}
POST /api/address
PUT /api/address/{id}
DELETE /api/address/{id}Most write operations require authentication through Laravel Sanctum.
Clone the repository:
git clone https://github.com/lucasbdourado/api-ecommerce.git
cd api-ecommerceInstall dependencies:
composer installCreate the environment file:
cp .env.example .envGenerate the application key:
php artisan key:generateConfigure your MySQL database in .env and run:
php artisan migrateStart the application:
php artisan serveThe API will be available at:
http://localhost:8000/api