Daniel1836's avatar

Coding Test for old job. (Laravel) Can someone help me understand?

The test is basically to create a CRUD app in Laravel

The part I am confused by is this: Maybe someone can explain to me in simple terms what they want.

3 ) Three Endpoints will be needed, for categories (of products), products and markets (for the products) 

4 ) Each of the 3 endpoints will have an id, timestamps and 3 pairs of fields called: title_fr/title_en, description_fr/description_en and url_fr/url_en 

5 ) Each product is linked to a single category (relationship is not localized). Each product can belong to multiple markets (relationship is not localized). Markets and Products do not have a relationship with each other. Make a GET on a product is made, return the Markers and the Category in the record, but Markets and Categories are standalone items when fetched from their GET.

It seems to me they want 3 endpoints (categories, products and markets). I don't understand what they mean by the relationships between endpoints (eloquent relationships?) or if each endpoint needs to have the 3 pairs of fields they asked for, or how I would code this.

Can anyone help me understand and break it down?

Thanks

0 likes
1 reply
Tray2's avatar

Basically you need routes, controllers and models for

  • categories
  • products
  • markets

Then you need migration for products

  • id
  • title_fr
  • title_en
  • description_fr
  • description_en
  • url_fr
  • url_en
  • category_id
  • created_at
  • updated_at

And migrations for markets and categories.

Add a one to one relation in the the category and product model.

Take in consideration that you need /en/ or /fr in your routes to display the correct description and url.

Please or to participate in this conversation.