Laravel-Challenge-ManyToMany-Olympics
Laravel-Challenge-ManyToMany-Olympics copied to clipboard
Task Implementation
Due to time limitations, I've partially implemented the task. For the rest, I added pseudo code to illustrate the idea.
- Added the
country_sport
migration to create this pivot table - Added
sports
relation on Country Model - Added
countries
relation on Sport Model - Added accessories on the
Country
Model representing thefirst place count
,second place count
, andthird place count
. - Amended the
create.blade.php
file and changed the naming of the HTML controls so that the backend, when the user submits the form, gets the following data:
scores: [
1 => [ // sport_id
"first" => "3", // place => country
"second" => "6",
"third" => "8"
],
...
]
- Added comments on
show.blade.php
on how to access country name and country places.
Many thanks! Bilal
@bhaidar unfortunately I don't have enough time for a personal review, but compare your code with my version - see my Pull Request #16 and I will also release a video on Youtube tomorrow with explanations.