← Laravel learning pathLaravel · Module 9 of 10
APIs, queues and mail
Build JSON APIs and handle background work.
📖 Key ideas
- API resources format JSON: php artisan make:resource PostResource.
- Queues run slow jobs (emails, reports) in the background.
- Create jobs: php artisan make:job SendWelcomeEmail; dispatch it.
- Run workers: php artisan queue:work.
- Mailables build emails: php artisan make:mail WelcomeMail.
💡 Real-life example: Queues are a dhobi service: drop clothes (jobs) now, get them washed later without waiting.
API ResourceTransforms models to JSON
QueueList of background jobs
JobTask run by a queue worker
MailableClass representing an email