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
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
The code in exercise-02.php contains two functions
get_ordersreturns a list of orders from the databaseget_orderreturns a specific order given the id of the order
- Identify any issues with the code and apply any fixes needed.
- Write a
get_order_with_detailsfunction that accepts an id and returns the corresponding order with details of the order, assuming the order details are stored in theorder_detailstable with the foreign keyorder_id. - What improvements can be made to the code?
Create a laravel application that implements the functionality of the resulting code in Exercise 2 above.