Skip to content

ikudosi/LawLine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Julius.Plaras
Aug 19, 2017
98a53df · Aug 19, 2017

History

20 Commits
Aug 19, 2017
Aug 18, 2017
Aug 18, 2017
Aug 19, 2017
Aug 18, 2017
Aug 19, 2017
Aug 18, 2017
Aug 19, 2017
Aug 19, 2017
Aug 18, 2017
Aug 18, 2017
Aug 19, 2017
Aug 18, 2017
Aug 18, 2017
Aug 18, 2017
Aug 18, 2017
Aug 18, 2017

Repository files navigation

Lawline Development Test

Stack used

This app written on Laravel 5.2 with PHP 7.1.

Set up

Please run the following commands:

  • composer install
  • Copy .env.example and rename to .env within the same directory
  • Run command: php artisan key:generate
    • Copy generated key to .env in APP_KEY (excluding the brackets)
  • php artisan migrate
  • php db:seed

Testing

All tests are under tests/app. To run simple run this command: phpunit

Routes

  • GET /api/products - This gets all the products
  • POST /api/product - This stores a product to the products table
  • GET /api/product/{id} - This gets a product by id
  • POST /api/product/{id} - This updates a product by id
  • DELETE /api/product/{id} - This deletes a product by id
  • GET /api/user/products - This gets all the products for the authorized user
  • PUT /api/user/product/{id} - This links the authorized to a product
  • DELETE /api/user/product/{id} - This un-links the authorized to a product
  • POST /api/product-image - This saves a product image to the server

Authentication

All routes under /api are under the 'auth:api' middleware. What this essentially means is that all requests must have a parameter of api_token. This token is the unique identifier of who is a valid api user based on the user table api_token column.

About

Github test for LawLine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published