The API-Laravel-Inventory-System is a RESTful API built with Laravel to streamline inventory management. It provides endpoints to handle products, categories, and stock levels, making it easy to integrate with various frontends or third-party applications.
- Product Management: CRUD operations for products in your inventory.
- Category Management: Organize your inventory into categories for better management.
- Stock Control: Track stock levels and update them dynamically.
- RESTful API: Easily connect with other applications via structured endpoints.
Before running the application, ensure you have the following installed:
- PHP: Version 8.1 or higher
- Composer: Dependency manager for PHP
- Postman (or any API testing tool): To test API endpoints
- MySQL or any SQL database
- XAMPP or similar stack (optional for local development)
Follow these steps to set up the API on your local machine:
-
Clone the Repository
git clone https://github.com/sotoJ24/Api-Laravel-Inventory-System.git cd Api-Laravel-Inventory-System
-
Install Dependencies
Run the following command to install PHP dependencies:composer install
-
Environment Setup
Copy the.env.example
file to create a new.env
file:cp .env.example .env
Update the
.env
file with your database configuration:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=inventory_system DB_USERNAME=root DB_PASSWORD=
-
Generate Application Key
php artisan key:generate
-
Run Migrations
Create the database tables by running:php artisan migrate
-
Run the Application
Start the local development server:php artisan serve
Access the API at http://127.0.0.1:8000.
Use a tool like Postman to test the following API endpoints:
- GET
/api/products
- List all products - POST
/api/products
- Create a new product - GET
/api/products/{id}
- Retrieve a specific product - PUT
/api/products/{id}
- Update a product - DELETE
/api/products/{id}
- Delete a product
- GET
/api/categories
- List all categories - POST
/api/categories
- Create a new category - GET
/api/categories/{id}
- Retrieve a specific category - PUT
/api/categories/{id}
- Update a category - DELETE
/api/categories/{id}
- Delete a category
For detailed Laravel framework documentation, visit: Laravel Documentation.
Contributions are welcome! If you encounter any issues or have feature requests, feel free to open an issue or submit a pull request.