For this assignment, create a new Laravel application called "assignment-2".
Rebuild Assignment 1 using Laravel, but with a few modifications to the requirements:
- The playlists page should be accessed through the URL
/playlists
. - Each playlist should be an anchor that links to
/playlists/{id}
, where{id}
is replaced with the ID of each playlist. - On the playlist details page, display a link with the text "Back to Playlists".
- 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. - The playlists page should have a document title (the
title
tag) of "Playlists". - 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.
- You don't have to redirect to
/playlists
when visiting a playlist where theid
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.