/laravel-stock-management

Laravel stock management system

Primary LanguagePHP

Laravel stock management system

This project has been developed using Laravel and Vuejs.

Quick Start

To install the application first copy .env.example int .env and update it accordingly. Then follow the steps bellow:

# Install Dependencies
composer install

# Run Migrations
php artisan migrate

# Import Articles
php artisan db:seed

# Add virtual host if using Apache

# If you get an error about an encryption key
php artisan key:generate

Note: Please don't forget to install npm packages.

Database schema

You can find the database schema here.

Endpoints

Create a new client

POST api/client

Payload:

{
    "username": "string"
}

Get all clients

GET api/client

Add a stock

POST api/stock

Payload:

{
    "company_name": "string",
    "unit_price": 0
}

Get all stocks

GET api/stock

Update a stock

PUT api/stock/{stock_id}

Payload:

{
    "unit_price": 0
}

Delete a stock

DELETE api/stock/{stock_id}

Purchase a stock for a client

PUT api/client{client_id}/stock/{stock_id}

Payload:

{
    "volume": 1
}