Code Monkey home page Code Monkey logo

pgphptest's Introduction

Pictureworks Laravel Coding Test


Build Status Total Downloads License

Introduction

Pictureworks Laravel Coding Test: Migration of non-oo legacy application into the Laravel/Eloquent framework.

Table of Contents

  1. Requirements
  2. Features
  3. Installation
  4. Usage
  5. Testing

Requirements

Make sure your server meets the following requirements.

  • PostgreSQL server
  • Composer installed 1.9+
  • PHP Version 7.4.x+

Features:

  • Show user detail
  • Update existing comments field of user with identifier id provided
  • A command line executions to update comments of specific user such as php controller.php ID COMMENTS where ID is user identifier and COMMENTS is some amount of comments, potentially with spaces.

Installation

Install composer with the help of the instructions given here

$ wget https://getcomposer.org/composer.phar
$ chmod +x composer.phar
$ mv composer.phar /usr/local/bin/composer

Fork and/or clone this project by running the following command

 git clone  https://github.com/umagloire99/pgphptest.git

Navigate into the project's directory

 cd pgphptest 

Copy .env.example for .env and modify according to your credentials

 cp .env.example .env

Run this command to install dependencies

 composer insatall --prefer-dist

This command will install all dependencies needed by the Pictureworks Laravel Coding Test to run successfully!

Generate application key

 php artisan key:generate

This command will help migrate the database and populate the database!

 php artisan migrate --seed

Usage

Specify your static user password in your .env that would be used to identify you

STATIC_USER_PASSWORD=''

Run the default laravel server

php artisan serve

Show User detail

  • Request: GET
  • Url http://localhost:8000/user/{id} where id is the unique user identifier

Update existing comments field of user

  • Request POST
  • Url http://localhost:8000/user/update-comments
  • Parameters: id(unique user identifier type integer), comments(type string) and password(type string)

By default, we have created 10 fake user data.

Testing

Run this command to test the different endpoints

vendor/bin/phpunit tests/UserControllerTests.php  

pgphptest's People

Contributors

umagloire99 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.