Laravel-Challenge-ManyToMany-Olympics icon indicating copy to clipboard operation
Laravel-Challenge-ManyToMany-Olympics copied to clipboard

Task Implementation

Open bhaidar opened this issue 3 years ago • 1 comments

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 the first place count, second place count, and third 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 avatar Aug 21 '21 23:08 bhaidar

@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.

PovilasKorop avatar Aug 24 '21 08:08 PovilasKorop