Home / Snippets / Laravel Intervention Image Change Driver
Laravel Intervention Image Change Driver cover

Laravel Intervention Image Change Driver

942

3 years ago

0 comments

In this short snippet, you will learn how to change the driver used by Laravel Intervention Image to either use "gd" or "imagick". Let's get started.

Step 1: Install Intervention Image


If you have not installed the Laravel Intervention Image package do run the command below.
composer require intervention/image

Step 2: Publish Intervention Image Configuration


Now that you have it installed it's time to publish the configuration like below.
php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravelRecent"

Laravel Intervention Driver Option


The driver for Laravel Intervention can be updated as follows. Do note that the location for the configuration is in "config/image.php".
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Image Driver
    |--------------------------------------------------------------------------
    |
    | Intervention Image supports "GD Library" and "Imagick" to process images
    | internally. You may choose one of them according to your PHP
    | configuration. By default PHP's "GD Library" implementation is used.
    |
    | Supported: "gd", "imagick"
    |
    */

    'driver' => 'gd'

];
The only value that you can specify for the driver is "gd" which is by default and "imagick". Do note that you need to have Imagick Installed on the machine in order to use the driver.

Other Reads

notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this