Skip to content

PaulBless/php-exercises

Repository files navigation

Guidelines

The exercises outlined below are designed to help us understand your approach to provlem sovling and development. We expect it to take about 30 minutes to complete the exercise.

There is no one single correct approach. Feel free to consult any resources available to you as needed (google & stack overflow inclusive ;-) ).

We may ask you questions as you work through the exercises to understand your thought process. If you need to concentrate, you may request that we hold our questions until you are done with the exercise you are currently working on

Exercise 1

The code in exercise-01.php makes use of a Config class. There are three echo statements in the file, each of which is meant to return a string. Identify what is wrong with the code and how it can be fixed

Exercise 2

The code in exercise-02.php contains two functions

  • get_orders returns a list of orders from the database
  • get_order returns a specific order given the id of the order
  1. Identify any issues with the code and apply any fixes needed.
  2. Write a get_order_with_details function that accepts an id and returns the corresponding order with details of the order, assuming the order details are stored in the order_details table with the foreign key order_id.
  3. What improvements can be made to the code?

Exercise 3

Create a laravel application that implements the functionality of the resulting code in Exercise 2 above.

About

this is the solution to the php exercise test {question 1 & 2}

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages