This repository contains two technical challenges designed to assess Laravel proficiency:
- A Collections Challenge testing your ability to transform structured data
- A Model Relationships Challenge testing your understanding of Laravel's relationships
We do not intend for this task to take a long time to complete and is not designed to be an intensive challenge.
This task is not designed to be time intensive, completing the tasks with simplistic, clean and readable code is most important - bonus points for flare.
This challenge is designed to show your fluency with Laravel's collection API, particularly your ability to transform structured data.
You're working with a dataset of characters from the world of Horizon Forbidden West. Each character has a tribe, skills, weapons, damage stats, and a flag indicating whether they're currently injured.
Your job is to remove the injured characters and return a transformed structure grouped by tribe, summarising key attributes about each group.
The test is complete when the test passes and you're satisfied with the code.
Using the provided $characters array:
- Filter out any characters who are injured
- Group the remaining characters by tribe
- For each tribe, return:
- A sorted list of member names
- A sorted, unique list of all skills
- A sorted, unique list of region names
- A sorted, unique list of weapons
- A damage summary:
mindamagemaxdamageaveragedamage (rounded to 1 decimal)
Your result must exactly match the $tribes array provided in the test.
This challenge tests your understanding of Laravel's relationships. The task is to implement a subscription system where both users and blogs can be subscribed to.
You need to create a relationship between:
- A
Subscriptionmodel - A
Usermodel - A
Blogmodel
The Subscription model should be able to belong to either a User or a Blog through a relationship.
- Create the necessary models and migrations
- Implement the relationships and any missing code
- Ensure the test passes
The test is complete when the test passes and you're satisfied with the code.
- Clone the repo
- Run
composer install - Run the tests with:
php artisan test --group collections php artisan test --group relations php artisan test
The test suite contains two tests:
tests/Unit/CollectionsTest.php- Tests the collections challengetests/Feature/ModelRelationsTest.php- Tests the model relationships challenge
Please submit your completed test either with a Github link or by emailing a zip of your repository to animmo [@] netwatchglobal .com
Good luck !