laravel-5.4-noteslisted
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