← ClaudeAtlas

laravel-6-noteslisted

Laravel 6.x (LTS, Sep 2019) signature features and the breaking-change traps from 5.8 → 6.0. Use when writing or reviewing code in a Laravel 6 project, or in a package whose composer constraint includes ^6.0. Covers job middleware, lazy collections, the Str/Arr helper migration, the strict-semver shift, and the deprecations Laravel 6 removed from 5.x. Not for application business logic — load when working on framework-touching code (service providers, jobs, model attributes) or planning a 5.8 → 6 upgrade.
hmj1026/dhpk · ★ 1 · AI & Automation · score 72
Install: claude install-skill hmj1026/dhpk
# Laravel 6 — LTS baseline Released September 2019. **First Laravel version on strict semver** — prior majors used a 5.x rolling number that did not signal breaking changes meaningfully. > PHP floor: 7.2 (use `php-7.4` module — there is no `php-7.2` module > shipped). LTS support ran through 2022. --- ## Signature features ### Job middleware ```php final class ThrottlesByCustomer { public function handle($job, callable $next): void { Redis::funnel('customer:' . $job->customerId) ->limit(1) ->then(fn () => $next($job), fn () => $job->release(5)); } } // In the Job class: public function middleware(): array { return [new ThrottlesByCustomer]; } ``` Wraps `Job::handle()` execution with composable middleware. Replaces ad-hoc rate-limit / dedup logic that previously had to live inside `handle()` itself. ### Lazy collections ```php LazyCollection::make(function () { $handle = fopen('huge.csv', 'r'); while (($row = fgetcsv($handle)) !== false) { yield $row; } })->filter(fn ($r) => $r[3] === 'active') ->each(fn ($r) => Order::create([...])); ``` Memory-bounded iteration over arbitrarily large datasets. Eloquent gained `cursor()` and `lazy()` methods that return `LazyCollection`. Use anywhere a regular `Collection` would `OOM` on a multi-GB dataset. ### Eloquent subquery selects ```php $users = User::addSelect(['last_login_at' => Login::select('created_at') ->whereColumn('user_id', 'users.id') -