Laravel 12.18.0 Update
June 17, 2025Laravel 12.18.0 Update
The Laravel team released version 12.18.0 with several cool updates:
- String encrypt() & decrypt() helpers are now available on
Stringable
instances. - New
--batched
option forphp artisan make:job
to generate batchable jobs. UsePolicy
attribute to explicitly specify a model’s policy.- Per-request HTTP client exception truncation control.
🔐 1. String encrypt/decrypt helpers
Instead of doing this:
// Before
$encryptedToken = str('secret-api-token')
->pipe(fn(Stringable $str) => encrypt($str->value()))
->prepend('encrypted:')
->append(':end');
// After
$encryptedToken = str('secret-api-token')
->encrypt()
->prepend('encrypted:')
->append(':end');
It’s much cleaner and fluent now.
⚙️ 2. Batchable job option
Needed a batchable job? Now you can just run:
php artisan make:job ProcessPodcast --batched
The generated class looks like this:
namespace App\Jobs;
use Illuminate\Bus\Batchable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
class ProcessPodcast implements ShouldQueue
{
use Batchable, Queueable;
public function handle(): void
{
if ($this->batch()->cancelled()) {
return;
}
// your processing logic here...
}
}
🏷️ 3. UsePolicy attribute
Now you can explicitly assign a policy:
#[UsePolicy(PostPolicy::class)]
class Post extends Model {}
No need to rely solely on convention.
🌐 4. HTTP client truncate exception limit
Control exactly how much of the exception response gets truncated per-call:
Http::truncateExceptionsAt(240)->post(/* ... */)
That’s the major highlights from Laravel 12.18.0. Check out the full changelog or GitHub diff to explore the rest.
Blog
Guide to Scroll‑Driven Animations with CSS
Jun 26, 2025
Guide to Scroll‑Driven Animations with CSS CSS animations can now be linked to user scrolling without any JavaScript — just pure CSS. 1. Thr...
Supercharge Your PHP Enums with archtechx/enums
Jul 01, 2025
Supercharge Your PHP Enums with archtechx/enums PHP 8.1 introduced native enums—type‑safe sets of named values like statuses or roles. The arch...
What’s New in ECMAScript 2025
Jun 30, 2025
What’s New in ECMAScript 2025 On June 25, 2025, Ecma International officially approved ES2025, adding several useful features: 1. 📦 Import At...
Laravel Queue & Job System: From Table Creation to Production Deployment
Jul 01, 2025
🚀 Laravel Queue & Job System We’re gonna walk you through Laravel queues from setup to deploying in production using Supervisor. Step 1...
How OAuth Works
Jun 29, 2025
How OAuth Works OAuth is a protocol that allows third-party applications to access user data without sharing passwords. It's the backbone of secure a...
Laravel 12.18.0 Update
Jun 17, 2025
Laravel 12.18.0 Update The Laravel team released version 12.18.0 with several cool updates: String encrypt() & decrypt() helpers are...
