Posts Learn Components Snippets Categories Tags Tools new About
/

Laravel Intervention Image Change Driver

Learn how to change driver in Laravel Intervention Image by updating the configuration file

Created on Sep 15, 2021

60 views

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

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

Load comments for Laravel Intervention Image Change Driver

)