For this assignment, scaffold a new Laravel application called "assignment-6".
On a page at the URL /stats
, add a button with the text "Email stats". This should be a form with a single button that makes a POST request to /stats
. This endpoint should send an HTML email to admin@apple.com with the following stats:
- Total number of artists
- Total number of playlists
- The average length of all tracks rendered in a format like "6 minutes and 33 seconds"
One approach to generating stats is writing aggregate queries.
Feel free to style it however you wish.
Other Requirements
- Emails should be queued.
- You must use a mailable class.
Testing emails
Like we did in class, use Mailpit (http://localhost:8025) to examine the outgoing email from your application.
Restarting the Queue Worker
Running php artisan queue:work
will run a queue worker, which is a long-lived processes and stores the booted application state in memory. As a result, it will not notice changes in your code base after it has been started. If you make changes to code, simply restart this command. Read Running The Queue Worker from the Laravel documentation for more details.
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 the README.md
file at the root of your project.
https://classroom.github.com/a/YcidfRru
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.