← ClaudeAtlas

laravel-5.4-noteslisted

Laravel 5.4 (February 2017) signature features and the breaking-change traps from 5.3 → 5.4. Use when writing or reviewing code in a Laravel 5.4 project, or in a package whose composer constraint includes 5.4.*. Covers Blade components & slots, route model binding, middleware groups, realtime facades, markdown mailables, higher-order messages, and the Elixir → Mix frontend transition. Not for application business logic — load when working on framework-touching code (Blade templates, routing, mailables, service providers, Mix config) or planning a 5.3 → 5.4 upgrade.
hmj1026/dhpk · ★ 1 · AI & Automation · score 72
Install: claude install-skill hmj1026/dhpk
# Laravel 5.4 — LTS baseline Released February 2017. Last of the 5.x line still running on the PHP 5.6 floor, and a heavy refactor of the frontend tooling story. > PHP floor: 5.6.4 (use the `php-5.6` module for the language > baseline). This is the era before strict semver — the 5.x rolling > number did not signal breaking changes meaningfully. --- ## Signature features ### Blade components & slots ```blade {{-- resources/views/components/alert.blade.php --}} <div class="alert alert-{{ $type }}"> <div class="alert-title">{{ $title }}</div> {{ $slot }} </div> {{-- consuming view --}} @component('components.alert', ['type' => 'danger']) @slot('title') Heads up @endslot The payment could not be processed. @endcomponent ``` First introduced in 5.4. `@component` / `@slot` replace the older pattern of `@include` plus a pile of passed variables. Named slots become variables inside the component; the body becomes `$slot`. ### Route model binding ```php // Implicit — type-hint the model, Laravel resolves by id Route::get('orders/{order}', function (Order $order) { return $order; }); // Explicit — custom key or scoping, in RouteServiceProvider::boot() Route::bind('order', function ($value) { return Order::where('public_token', $value)->firstOrFail(); }); ``` Override `getRouteKeyName()` on the model to bind by a column other than the primary key. ### Middleware groups (web / api) ```php // app/Http/Kernel.php protected $middlewareGroups = [ 'we