dashed/laravel-drift

1,002
Install
composer require dashed/laravel-drift
Latest Version:v1.0.20
PHP:^8.4|^8.3
License:MIT
Last Updated:Sep 1, 2026
Links: GitHub  ·  Packagist
Maintainer: Robinvm

Laravel Drift

Optimize images on the fly.

Installation

You can install the package via composer:

composer require dashed/laravel-drift

Usage

Simply install the package, and register a configuration in AppServiceProvider@boot:

use Dashed\Drift\Config;
use Dashed\Drift\DriftManager;
use Dashed\Drift\CachingStrategies\FilesystemCachingStrategy;

/** @var DriftManager $drift */
$drift = app(DriftManager::class);

$drift->registerConfig(new Config(
    name: 'my-config-name', // Will be used in the slug
    filesystemDisk: 'filesystems-disk-name', // Local, public or s3 for example
    cachingStrategy: FilesystemCachingStrategy::class, // Create your own or use the defaults like FilesystemCachingStrategy or NullCachingStrategy
));

Image URLs

To generate an image URL use the \Dashed\Drift\UrlBuilder like so:

use Dashed\Drift\UrlBuilder;

/** @var UrlBuilder $builder */
$builder = app(UrlBuilder::class);

$image = $builder->url('my-config-name', 'example.png', [
    'resize' => [1920, 1080],
    'encode' => 'webp', // The fallback encoding will be webp
]);

You can use most of Intervention Image's methods, simply use the method name as key and set the argument as value. Have more than one argument? Use an array instead like in the example above.

Blade Component

<x-drift::image
    class="w-full aspect-[16/9] object-cover"
    config="my-config-name"
    path="example.png"
    :manipulations="[
        'encode' => ['jpeg', 50],
        'greyscale' => true,
    ]"
/>

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
v1.0.20 ^8.4|^8.3 ^11.0|^12.0|^13.0 MIT
v1.0.19 ^8.4|^8.3 ^12.0|^11.0 MIT
v1.0.18 ^8.4|^8.3 ^12.0|^11.0 MIT
v1.0.17 ^8.4|^8.3 ^12.0|^11.0 MIT
v1.0.16 ^8.4|^8.3 ^12.0|^11.0 MIT