← Laravel learning path
Laravel · Module 9 of 10

APIs, queues and mail

Build JSON APIs and handle background work.

📖 Key ideas

  1. API resources format JSON: php artisan make:resource PostResource.
  2. Queues run slow jobs (emails, reports) in the background.
  3. Create jobs: php artisan make:job SendWelcomeEmail; dispatch it.
  4. Run workers: php artisan queue:work.
  5. 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