/laravel-townsend

Townsend Music Laravel project

Primary LanguagePHP

Townsend Music Laravel Coding Test

Objective

Your task is to refactor the GetProductsController without altering its existing functionality fixing any bugs that you may find.

Existing API Route

We have an existing API route, /api/products, which returns all products. This functionality should remain unchanged.

New API Route

Please create a new API route /api/products/{section}, which will return all products belonging to a specified section.

Models and Relationships

The models and their relationships have already been established; there's no need for additional configuration in this area.

Development Environment

You are free to use any methodologies or packages as deemed fit for this task. Set up your dev environment using the setup that you are most comfortable with. The project already includes Laravel Sail for your convenience.

Test Data

Test data is provided through seeders. After running the php artisan migrate --seed command, your database should be ready for use.

Time Constraint

While we understand the time-consuming nature of coding tasks, we kindly request that you limit yourself to a maximum of one to two hours on this task. Please do not worry if you can't complete the task within the stipulated time. Our primary interest is in assessing your problem-solving approach and your understanding of the Laravel framework and best practices, not necessarily the end product. Any notes about your strategies for tackling this task, or your thoughts on potential improvements to the code, are greatly appreciated.

Submitting the Test

The easiest way for all involved to review this test is via GitHub. We request that you Fork this project and then perform the "task" on your fork as a public repsoitory. Once completed please submit a link back to us on email. Any notes on your strategy or improvements should be added to the repository in a NOTES.md