Your Cart
Loading

Laravel 12 Cookbook, Second Edition: Build, secure, and scale your apps with solutions across authentication, routing, security, media, APIs, queues, scheduling and automation

On Sale
$27.99
$27.99
Added to cart

Build and deploy web apps at super-fast speed with Laravel 12.


There's nothing like this out there. This book is an absolute recipe-based book for PHP developers covering practical, battle-tested solutions for building, securing and maintaining production-grade Laravel 12 applications on Linux. It's all broken down into a bunch of focused recipes that actually tackle some of the real-world backend challenges you might face.


From scratch, you'll get to configure a secure PHP 8.5 and Laravel 12 environment, design expressive Eloquent models with complex relationships, and enforce layered authentication and role-based access control using Breeze, Socialite, and Fortify. I'll show you to build multi-channel notification systems, integrate real-time broadcasting with Pusher and Laravel Echo, and offload heavy work to queued jobs with retry strategies, chaining, and batching. We'll go through file storage, media management, image processing with Intervention Image v3, and secure S3 integration in detail, as well as temporary signed URL generation and a reusable media registry.


And the last few chapters are all about automation and reliability, like scheduling tasks using routes/console.php, running automated database backups with Spatie Laravel Backup, getting rid of stale data with the Prunable trait, and keeping an eye on your app's health with Telescope and Pulse.


Key Learnings

  • Make a production-ready Laravel 12 environment on Linux from scratch.
  • Create eloquent relationships and optimize queries using eager loading and scopes.
  • Implement layered authentication with Breeze, Socialite, Fortify, and RBAC middleware.
  • Run server-side validation with custom closure rules and tailored error messages.
  • Centralize exception handling using Laravel 12's bootstrap-first callback.
  • Dispatch, chain, and batch background jobs with robust retry and failure handling.
  • Deliver real-time notifications via database, email, SMS, and WebSocket broadcasting.
  • Process, resize, and store media securely using Intervention Image v3 and AWS S3.
  • Automate recurring maintenance tasks using console and cron.
  • Monitor application health and prune stale data through Pulse and Telescope.


Table of Content

  1. Setting up PHP 8.5 and Laravel 12
  2. Advanced Routing, Controllers, and Blade Views
  3. Authentication and Authorization
  4. Database Models, Migrations, and Query Optimization
  5. Data Validation and Error Management
  6. Alerts, Notifications, and Performance Monitoring
  7. Job Queues and Background Processes
  8. File Storage, Media Management, and Processing
  9. Scheduling, Automation, and Backup Tasks