Laravel 13.20: First-Party Image Processing | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://www.msaied.com/public) - [Home](https://www.msaied.com/public)
- [Projects](https://www.msaied.com/public/projects)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [About](https://www.msaied.com/public#about)

           [  Contact](https://www.msaied.com/public#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://www.msaied.com/public)
- [ProjectsCase studies](https://www.msaied.com/public/projects)
- [ArticlesEngineering notes](https://www.msaied.com/public/articles)
- [CertificatesCredentials](https://www.msaied.com/public/certificates)
- [AboutHow I work](https://www.msaied.com/public#about)
- [ContactGet in touch](https://www.msaied.com/public#contact)

  [Start a conversation](https://www.msaied.com/public#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://www.msaied.com/public)
2. /
3. [Articles](https://www.msaied.com/public/articles)
4. /
5. [Laravel](https://www.msaied.com/public/articles?category=laravel)
6. /
7. First-Party Image Processing in Laravel 13.20

   [Laravel](https://www.msaied.com/public/articles?category=laravel) 

 First-Party Image Processing in Laravel 13.20
==============================================

 Laravel 13.20 ships a built-in Image facade with an immutable, driver-based API for resizing, cropping, and format conversion, plus a WithoutMiddleware attribute, Redis session prefix, and more.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://www.msaied.com/public#person) Published 15 Jul 2026 · Updated 15 Jul 2026 · 3 min read

ShareCopy linkCopied

 ![First-Party Image Processing in Laravel 13.20](https://cdn.msaied.com/428/f426d416be5b32c85a6eb69b1dbb5d74.png) 

  On this page +1. [First-Party Image Processing with the Image Facade](#first-party-image-processing-with-the-codeimagecode-facade)
2. [Loading Images](#loading-images)
3. [Available Transformations](#available-transformations)
4. [Drivers](#drivers)
5. [\#\[WithoutMiddleware\] Controller Attribute](#codewithoutmiddlewarecode-controller-attribute)
6. [Redis Session Prefix](#redis-session-prefix)
7. [Quiet Bulk Increments on Eloquent](#quiet-bulk-increments-on-eloquent)
8. [Enums as WithoutOverlapping Queue Keys](#enums-as-codewithoutoverlappingcode-queue-keys)
9. [Other Improvements](#other-improvements)
10. [Key Takeaways](#key-takeaways)

 Laravel 13.20.0, released on July 15, 2026, is a notable minor release that brings first-party image processing directly into the framework alongside several quality-of-life improvements for routing, sessions, Eloquent, and queues.

First-Party Image Processing with the `Image` Facade
----------------------------------------------------

The headline feature is the new `Illuminate\Image` component. It provides an immutable, driver-based API for common image operations — resizing, cropping, format conversion, and storage — without requiring a third-party wrapper package.

Because every transformation returns a new instance, you can branch from a single source image to produce multiple variants without side effects:

```php
$image = $request->image('photo');

$image->cover(200, 200)->toWebp()->store('thumbnails');
$image->grayscale()->toWebp()->store('grayscale');

```

### Loading Images

You can create an `Image` instance from uploads, paths, URLs, raw bytes, base64 strings, or a storage disk:

```php
$request->image('avatar')->cover(200, 200)->toWebp()->store('avatars');

Image::fromPath('/path/to/photo.jpg');
Image::fromUrl('https://example.com/photo.jpg');
Image::fromBytes($bytes);
Image::fromStorage('photos/avatar.jpg', 's3');
Storage::disk('s3')->image('photos/avatar.jpg');

```

### Available Transformations

The API covers the most common operations:

```php
$image->cover(200, 200);
$image->contain(800, 600);
$image->resize(1024, 768);
$image->rotate(90);
$image->blur(10);
$image->sharpen(10);
$image->grayscale();
$image->flip();
$image->orient(); // Applies EXIF rotation

$image->toWebp();
$image->toJpg()->quality(80);
$image->optimize(); // WebP at quality 70

$image->width();
$image->height();
$image->mimeType();

```

### Drivers

Two drivers ship out of the box — GD and Imagick — both backed by Intervention Image v4. You can select a driver per image instance and override how a driver handles a specific transformation:

```php
$image->usingImagick();
$image->usingGd();

```

Intervention Image is a *suggested* dependency, so you must install it before using the facade:

```bash
composer require intervention/image

```

`#[WithoutMiddleware]` Controller Attribute
-------------------------------------------

A new `#[WithoutMiddleware]` PHP attribute complements the existing `#[Middleware]` attribute. Apply it to individual controller methods to exclude middleware that is attached at the class level:

```php
#[Middleware(EnsureTokenIsValid::class)]
class UserController
{
    public function index() { /* middleware applies */ }

    #[WithoutMiddleware(EnsureTokenIsValid::class)]
    public function profile() { /* middleware excluded */ }
}

```

Matching uses `ReflectionAttribute::IS_INSTANCEOF`, so subclasses of the excluded middleware are also excluded.

Redis Session Prefix
--------------------

Applications that share a Redis instance for both cache and sessions can now configure a dedicated prefix in `config/session.php`:

```php
'prefix' => env('SESSION_PREFIX', Str::slug(env('APP_NAME', 'laravel')).'-session-'),

```

The cache store is cloned before the session prefix is applied, so cache keys are unaffected.

Quiet Bulk Increments on Eloquent
---------------------------------

Two new methods — `incrementEachQuietly()` and `decrementEachQuietly()` — update multiple columns at once while suppressing model events:

```php
$user->incrementEachQuietly(['posts_count' => 1, 'points' => 10]);
$user->decrementEachQuietly(['credits' => 3, 'tokens' => 2]);

```

Enums as `WithoutOverlapping` Queue Keys
----------------------------------------

The `WithoutOverlapping` job middleware now accepts a PHP enum directly as its key, removing the need to manually convert enum values to strings.

Other Improvements
------------------

- `beforePushing()` / `afterPushing()` callbacks on `QueueFake`
- `Storage::assertEmpty()` added to the Storage facade
- `make:migration` generates collision-free, ordered timestamp prefixes
- `#[SensitiveParameter]` applied to parameters carrying secrets to keep them out of stack traces
- `Str::containsAll()` no longer returns `true` for an empty needles array
- Fixes for `BelongsToMany::touch()` when the related key is not `id`

Key Takeaways
-------------

- Laravel 13.20 ships a native `Image` facade — no more mandatory third-party image packages.
- The image API is immutable; every transformation returns a new instance.
- GD and Imagick drivers are included; `intervention/image` must be installed separately.
- `#[WithoutMiddleware]` brings route-group exclusion behavior to controller attributes.
- A new `SESSION_PREFIX` env variable isolates session keys in a shared Redis keystore.
- `incrementEachQuietly()` and `decrementEachQuietly()` fill a long-standing Eloquent gap.

---

*Source: [Laravel News — First-Party Image Processing in Laravel 13.20](https://laravel-news.com/laravel-13-20-0)*

- [Laravel](https://www.msaied.com/public/articles?search=Laravel)
- [Image Processing](https://www.msaied.com/public/articles?search=Image%20Processing)
- [Laravel 13](https://www.msaied.com/public/articles?search=Laravel%2013)
- [Eloquent](https://www.msaied.com/public/articles?search=Eloquent)
- [Queue](https://www.msaied.com/public/articles?search=Queue)

 Frequently asked questions 
---------------------------

  Do I need to install a separate package to use the new Image facade in Laravel 13.20?Yes. The image component depends on Intervention Image v4, which is listed as a suggested dependency rather than a required one. Run `composer require intervention/image` before using the `Image` facade or `$request-&gt;image()` helper.

   How does the immutable image API work in practice?Every transformation method returns a new `Image` instance rather than modifying the original. This means you can call multiple transformation chains on the same source image — for example, generating a thumbnail and a grayscale variant — without one chain affecting the other.

   Will setting a Redis session prefix affect my existing cache keys?No. Laravel clones the cache store before applying the session prefix, so your cache keys remain unchanged. The `SESSION\_PREFIX` option is opt-in and only affects session keys stored in Redis.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://www.msaied.com/public#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://www.msaied.com/public#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articlePostgreSQL CTEs, Window Functions, and Lateral Joins in Laravel](https://www.msaied.com/public/articles/postgresql-ctes-window-functions-and-lateral-joins-in-laravel-3) [Next articleLaravel Legacy Bridge: Carry Authenticated Sessions from a Legacy PHP App into Laravel](https://www.msaied.com/public/articles/laravel-legacy-bridge-carry-authenticated-sessions-from-a-legacy-php-app-into-laravel)  

   On this page
-------------

1. [First-Party Image Processing with the Image Facade](#first-party-image-processing-with-the-codeimagecode-facade)
2. [Loading Images](#loading-images)
3. [Available Transformations](#available-transformations)
4. [Drivers](#drivers)
5. [\#\[WithoutMiddleware\] Controller Attribute](#codewithoutmiddlewarecode-controller-attribute)
6. [Redis Session Prefix](#redis-session-prefix)
7. [Quiet Bulk Increments on Eloquent](#quiet-bulk-increments-on-eloquent)
8. [Enums as WithoutOverlapping Queue Keys](#enums-as-codewithoutoverlappingcode-queue-keys)
9. [Other Improvements](#other-improvements)
10. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://www.msaied.com/public#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/740/cce86edc21eddcbdd2f2454fadaf9c70.png)  · 3 min read### The Pipeline Pattern in Laravel: Custom Pipelines Beyond Middleware

5 Oct 2026 ](https://www.msaied.com/public/articles/the-pipeline-pattern-in-laravel-custom-pipelines-beyond-middleware-1) [ ![](https://cdn.msaied.com/739/2d6897fdcdcf090613f96f72a64b8a78.png)  · 4 min read### MySQL Full-Text Search in Laravel: Indexes, Relevance Scoring, and Boolean Mode

4 Oct 2026 ](https://www.msaied.com/public/articles/mysql-full-text-search-in-laravel-indexes-relevance-scoring-and-boolean-mode) [ ![](https://cdn.msaied.com/738/073696a3fefe18bec825beec5ac658f5.png)  · 4 min read### Laravel Queue Rate-Limited Middleware: Throttling Jobs Without Losing Work

4 Oct 2026 ](https://www.msaied.com/public/articles/laravel-queue-rate-limited-middleware-throttling-jobs-without-losing-work) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://www.msaied.com/public#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://www.msaied.com/public)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://www.msaied.com/public/sitemap.xml)
