The assessment has two parts:
The candidate needs to implement a backend REST API - GET /api/products/
which returns a list of all
products.
The candidate needs to display all products in Wordpress page then the public user is able to see a list of products on Web page.
This is a take-away assessment should take no longer than 2-3 hours.
-
Please Fork this repo and install this laravel repo locally
-
The code has provided a simple structure for you to start:
- A
ProductApiController.php
that contains a function which requires you to implement the logic - A
ProductApiRequest.php
- A
Product.php
eloquent model - A registered route in
api.php
(we do not require any auth or middleware in this assessment) - A seeder class for you to seed initial Product data for live testing
- A factory file
ProductFactory.php
- use it for mock
- A
-
Please finish API endpoint by satisfying the following requirements:
The API needs to satisfy
GET /api/products
- supports query filter:
is_active
only accepts1
or0
and itsrequired
- support query validation by using
ProductApiRequest.php
- products should not display
hidden_information
field - Write a feature test for the API. The test needs to check status and response data.
- supports query filter:
- Install a fresh wordpress project on your own
- Call the API that you have done in Part 1
- Display result in a wordpress page as HTML format:
<ul>
<li>Product 1</li>
<li>Product 2</li>
....
</ul>
- Adding all your notes into this
readme
- Send us your forked repo link
- create a public repo under your github account for the WP project, and send us the link
- Include any special setup details if you need to tell us in the
readme
If you think the task can be done within a short time frame, you can consider adding your own features to the assessment.
Some potential add-ons:
- Add filter option on
is_active
in wordpress page - Add wildcard search on name filter in API or in wordpress page
- Or any other idea you could come up with
You can be creative and expand functionality as long as requirements are met.
Happy Coding!
Email us if you have any questions: ryan@plastiq.it and marco@plastiq.it