Laravel, one of the most popular PHP frameworks, continues to innovate and improve with each release. The latest version, Laravel 11.26, introduces several powerful features that enhance both developer productivity and performance. From graceful process termination to improved rate limiting, let’s dive into the exciting updates in this release.
1. Using Enums with Rate Limiters
Seth Phat has contributed a fantastic new feature that allows developers to register rate limiters using BackedEnum
and UnitEnum
. This brings more flexibility and cleaner code when defining rate limiters in your application.
- Rate Limiting with Enums:
use Illuminate\Support\Facades\RateLimiter;
RateLimiter::for(
GlobalRateLimit::HUBSPOT,
fn () => Limit::perSecond(100, 10)
);
- Using Rate Limiters in Job Middleware: You can also apply these enums when setting up rate-limited queue job middleware:
use Illuminate\Queue\Middleware\RateLimited;
public function middleware(): array
{
return [
new RateLimited(GlobalRateLimit::HUBSPOT)
];
}
2. New make:job-middleware Artisan Command
Davey Shafik contributed a new Artisan command to streamline the process of creating job middleware. With this addition, you can generate job middleware within the App\Jobs\Middleware
namespace in just one command.
- Create Middleware Easily:
php artisan make:job-middleware RateLimited
This saves time and promotes better organization for job middleware, especially when scaling applications.
3. Graceful Process Termination for Single Processes and Pools
In version 11.26, Mathias Hansen introduced a method to gracefully stop processes or pools of processes. Whether you’re dealing with individual processes or managing a pool of them, you now have better control over stopping them safely without abrupt termination.
- Stopping a Single Process:
$process = Process::timeout(120)->start('bash import.sh');
$process->stop();
- Stopping a Pool of Processes:
$this->pool = Process::pool(function (Pool $pool) {
$pool->path(base_path())->command('sleep 5');
$pool->path(base_path())->command('sleep 10');
})->start();
// Gracefully stop the pool
$this->pool->stop();
4. Factory Generic Annotation in make:model
Punyapal Shah has improved how Laravel stubs work with factories. Before version 11.26, generating models with factories left the IDE unclear about the return type of Model::factory()
. Now, thanks to generic annotations, the IDE can better understand the type returned, improving developer experience.
- Before:
class Post extends Model
{
use HasFactory;
}
- After
class Post extends Model
{
/** @use HasFactory<\Database\Factories\PostFactory> */
use HasFactory;
}
Conclusion
Laravel 11.26 brings notable enhancements, empowering developers with more refined tools like graceful process handling, Enum support for rate limiters, and clearer annotations for factories. These features not only improve the developer experience but also ensure that applications are more efficient and maintainable.

Laravel 11.26 Official Release Notes : Click here
Want to read more interesting blogs like this……Visit https://www.codersbrain.com/blog/