Laravel broadcasting with Pusher for real-time events

Broadcasting enables real-time features by pushing server events to connected clients via WebSockets. I implement ShouldBroadcast on events to automatically broadcast them when fired. The broadcastOn() method defines channels—public, private, or prese

Laravel database migrations for schema management

Migrations version control database schema changes, making them trackable and reversible. Each migration file contains up() and down() methods defining changes and rollbacks. I use the Schema builder's fluent API to create tables, add columns, define

Laravel mix/Vite for asset compilation

Laravel Vite (replacing Mix) compiles and bundles frontend assets with hot module replacement during development. I define entry points in vite.config.js—typically resources/js/app.js and resources/css/app.css. The @vite directive includes compiled as

Laravel file storage with disk abstraction

Laravel's filesystem abstraction treats local, S3, FTP, and other storage identically. I configure disks in config/filesystems.php with drivers and credentials. The Storage facade provides methods like put(), get(), delete() that work across all disks

Laravel Blade components for reusable UI

Blade components create reusable, self-contained UI elements with their own logic and styling. Anonymous components are simple Blade files, while class-based components have PHP backing classes. I pass data via attributes—<x-alert type='success' /&

Laravel test writing with PHPUnit

Laravel's testing suite built on PHPUnit makes writing tests straightforward. Feature tests simulate HTTP requests and assert responses, while unit tests focus on individual methods. I use database transactions or RefreshDatabase to reset the database

Laravel accessors and mutators for attribute handling

Accessors and mutators transform model attributes when retrieving or setting values. Accessors format data for presentation—converting cents to dollars, concatenating names, or generating computed properties. Mutators normalize input—hashing passwords

Laravel cache strategies for performance

Caching dramatically improves performance by storing expensive computations or database queries. Laravel supports multiple cache drivers—Redis, Memcached, file, database. I use Cache::remember() to fetch or compute and cache values with expiration. Ca

Laravel scopes for reusable query logic

Query scopes encapsulate common query constraints into reusable methods on models. Local scopes prefix methods with scope and accept a query builder plus additional parameters. I chain scopes fluently—Post::published()->featured()->get(). Global

Laravel notifications for multi-channel messaging

Laravel notifications send messages across email, SMS, Slack, database, and more via a unified API. I create notification classes extending Notification with channel-specific methods—toMail(), toDatabase(), toSlack(). The via() method determines which

Laravel rate limiting for API protection

Rate limiting prevents API abuse by restricting request frequency per user or IP. Laravel's RateLimiter facade defines limits in RouteServiceProvider. I apply limiters via middleware—throttle:api for the default API limiter. Custom limiters use closur

Laravel Inertia.js for modern SPAs

Inertia.js bridges Laravel backends with Vue, React, or Svelte frontends without building a separate API. Server-side controllers return Inertia responses containing component names and props. The frontend renders those components with reactive framew