Laravel
25 notes
Best Practices
-
Avoiding N+1 Queries in Laravel
Learn what the N+1 query problem is, why it silently degrades Laravel application performance, and h...
-
Cache Invalidation Strategies in Laravel
Strategies for keeping your Laravel cache in sync with data, covering tag-based invalidation, model...
-
Caching in Laravel
An overview of Laravel's cache system, covering cache drivers, storing and retrieving data, cache ta...
-
Contextual Attributes in Laravel
How to use Laravel's contextual attributes to inject different implementations of an interface depen...
-
Custom Collections in Laravel
How to create custom collection classes in Laravel to attach domain-specific behaviour to groups of...
-
Eloquent Builder vs Scopes in Laravel
When to use a custom Eloquent Builder, local scopes, and global scopes for organising reusable query...
-
Form Request Validation Patterns in Laravel
How to use Laravel Form Request classes for clean, reusable, and testable validation and authorisati...
-
Health Checks in Laravel
How to implement a health check endpoint in Laravel so load balancers and monitoring tools can verif...
-
Immutable Dates in Laravel
How to use CarbonImmutable in Laravel to prevent subtle date mutation bugs, including setup and prac...
-
Logging in Laravel
An overview of Laravel's logging system, covering log levels, channels, stacking channels, and best...
-
Mass Assignment Guarding in Laravel
How to protect your Laravel models from mass assignment vulnerabilities using the fillable and guard...
-
Monitoring and Alerting in Laravel
How to add error tracking, uptime monitoring, and application performance monitoring to a Laravel ap...
-
Performance Improvements in Laravel
Practical techniques for improving Laravel application performance, covering eager loading, query op...
-
Pruning Data in Laravel
How to use Laravel's Prunable trait to automatically delete outdated model records on a schedule.
-
Queues in Laravel
How to use Laravel's queue system to defer time-consuming tasks, covering job creation, dispatching,...
-
Rate Limiting in Laravel
How to implement rate limiting in Laravel to protect routes and API endpoints from abuse using the t...
-
Read/Write Database Splitting in Laravel
How to configure read/write database splitting in Laravel to direct SELECT queries to read replicas...
-
Route Organisation and Naming in Laravel
Best practices for organising and naming routes in Laravel, covering named routes, route groups, res...
-
Scheduled Tasks in Laravel
How to define and manage scheduled tasks in Laravel using the task scheduler, including cron setup,...
-
Secrets and Config Validation in Laravel
How to validate that all required environment variables are present at application startup to preven...
-
Security Headers in Laravel
How to add HTTP security headers to a Laravel 12 application to protect against clickjacking, XSS, c...
-
Using .env in Laravel
Best practices for using the .env file in Laravel to manage environment-specific configuration and k...
-
Working with Large Datasets in Laravel
How to process large volumes of data in Laravel without exhausting memory, using chunking, lazy coll...
-
Laravel Coding Standards
Laravel-specific coding standards and best practices covering controllers, validation, Eloquent, rou...
-
Laravel Pint: Code Style Formatting
A guide to using Laravel Pint for automated PHP code style formatting, covering installation, config...