Laravel 13.20: First-Party Image Processing | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    First-Party Image Processing in Laravel 13.20        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)

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

 [  Laravel ](https://msaied.com/articles?category=laravel)  #Laravel   #Image Processing   #Laravel 13   #Eloquent   #Queue  

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

     15 Jul 2026      3 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

  10 sections  

1. [  01   First-Party Image Processing with the Image Facade  ](#first-party-image-processing-with-the-codeimagecode-facade)
2. [  02   Loading Images  ](#loading-images)
3. [  03   Available Transformations  ](#available-transformations)
4. [  04   Drivers  ](#drivers)
5. [  05   #\[WithoutMiddleware\] Controller Attribute  ](#codewithoutmiddlewarecode-controller-attribute)
6. [  06   Redis Session Prefix  ](#redis-session-prefix)
7. [  07   Quiet Bulk Increments on Eloquent  ](#quiet-bulk-increments-on-eloquent)
8. [  08   Enums as WithoutOverlapping Queue Keys  ](#enums-as-codewithoutoverlappingcode-queue-keys)
9. [  09   Other Improvements  ](#other-improvements)
10. [  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)*

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Ffirst-party-image-processing-in-laravel-1320&text=First-Party+Image+Processing+in+Laravel+13.20) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Ffirst-party-image-processing-in-laravel-1320) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  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. 

      Q02  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. 

      Q03  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. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![New in Laravel 13: First-Party Image Manipulation](https://cdn.msaied.com/427/504aed7f9f1c4a1cd411c7c4a4b6bc7c.png) Laravel 13 Image Manipulation PHP 

### New in Laravel 13: First-Party Image Manipulation

Laravel 13 introduces a first-party image manipulation feature, removing the need for third-party packages for...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 15 Jul 2026     3 min read  

  Read    

 ](https://msaied.com/articles/new-in-laravel-13-first-party-image-manipulation) [ ![Filament v4 Testing with Pest: Resources, Actions, and Form Assertions](https://cdn.msaied.com/426/a81430a378b2849b6fbecb8235b9119f.png) filament pest testing 

### Filament v4 Testing with Pest: Resources, Actions, and Form Assertions

A practical guide to testing Filament v4 panels using Pest — covering resource page assertions, table action d...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 15 Jul 2026     3 min read  

  Read    

 ](https://msaied.com/articles/filament-v4-testing-with-pest-resources-actions-and-form-assertions) [ ![Laravel Legacy Bridge: Carry Authenticated Sessions from a Legacy PHP App into Laravel](https://cdn.msaied.com/429/5abced4ee695d6c03e3ae41bbf2fe4bb.png) Laravel PHP Session Management 

### Laravel Legacy Bridge: Carry Authenticated Sessions from a Legacy PHP App into Laravel

Laravel Legacy Bridge is a package that reads a legacy session cookie, decodes the payload from the legacy dat...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 15 Jul 2026     4 min read  

  Read    

 ](https://msaied.com/articles/laravel-legacy-bridge-carry-authenticated-sessions-from-a-legacy-php-app-into-laravel) 

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

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
