Assignment 2

For this assignment, create a new Laravel application called "assignment-2".

Rebuild Assignment 1 using Laravel, but with a few modifications to the requirements:

  1. The playlists page should be accessed through the URL /playlists.
  2. Each playlist should be an anchor that links to /playlists/{id}, where {id} is replaced with the ID of each playlist.
  3. On the playlist details page, display a link with the text "Back to Playlists".
  4. On the playlist details page, display the total number of tracks in a playlist in the format "Total tracks: N" above the table only when there are tracks. You can use the count() function in PHP for this. You can also call ->count() on any database collection.
  5. The playlists page should have a document title (the title tag) of "Playlists".
  6. A playlist details page should have a document title in the format of "Playlist: NAME" where NAME is replaced with the name of the playlist.
  7. You don't have to redirect to /playlists when visiting a playlist where the id doesn't exist

Code Requirements

  • Use Laravel's Blade templating. All pages should use a single layout that you define.
  • All pages should contain the full HTML skeleton
  • All database queries should use Laravel's Query Builder
  • All routes should map to a controller
  • All URLs should use the route() helper function

Tips

  • You can create a controller using the artisan command php artisan make:controller PlaylistController

Submission

Create a video with audio using Zoom where you demo your assignment and explain where you fulfilled or did not fulfill each requirement. Put a link to this recording in a README.md file at the root of your project.

https://classroom.github.com/a/L5WJLCDT

If you're having problems uploading to GitHub, please zip up your project excluding the vendor folder and email it to the instructor and TA. Please include the Zoom recording URL in the email.