For this assignment, scaffold a new Laravel application called "assignment-2".
Playlist Pages
Create a page at /playlists
that displays all playlists from the playlists
table.
Each playlist should be an anchor that links to /playlists/{id}
, where {id}
is replaced with the ID of each playlist.
When a user clicks on a playlist link, they should be taken to a page that displays all tracks for that playlist. Display the following information for each track in an HTML table:
- Track name
- Album title
- Artist name
- Genre name
Display the name of the playlist at the top of the page.
Display a link with the text "Back to Playlists" on a playlist page, similar to the "Back to Invoices" link.
Display the total number of tracks in a playlist on a playlist page in the format "Total tracks: N". You can use the count()
function in PHP for this. You can also call ->count()
on any database collection.
Page Layout
- Add a link in the navigation for the playlists page
- All pages should contain the full HTML skeleton
- The playlists page should have a document title (the
title
tag) and page title of "Playlists" - A playlist page should have a document title and page title in the format of "Playlists: NAME" where NAME is replaced with the name of the playlist
Other Requirements
- Use Laravel's Blade templating. All pages should use a single layout that you define.
- 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
Deploy to Heroku / Zoom Recording
Deploy your Laravel app to Heroku and verify that it works. At the top of your project's README.md
, add your Heroku link.
Alternatively, create a Zoom recording where you walk us through all of the requirements of the assignment. Put this link at the top of your project's README.md
.
GitHub Classroom Submission
https://classroom.github.com/a/ApPHrEX0
Please read the section on Git, GitHub, and GitHub Classroom on the class welcome page if you need to refresh yourself.