PHP code example of mrofi / laravel-glide

1. Go to this page and download the library: Download mrofi/laravel-glide library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mrofi / laravel-glide example snippets


GlideImage::create($pathToImage)
	->modify(['w'=> 50, 'filt'=>'greyscale'])
	->save($pathToWhereToSaveTheManipulatedImage);


// config/app.php

'providers' => [
    ...
    Spatie\Glide\GlideServiceProvider::class,
    ...
];


// config/app.php

'aliases' => [
	...
    'GlideImage' => Spatie\Glide\GlideImageFacade::class,
    ...
]




return [

    /*
     * The driver that will be used to create images. Can be set to gd or imagick.
     */
    'driver' => 'gd',
];


GlideImage::create($pathToImage)
	->modify(['w'=> 50, 'filt'=>'greyscale'])
	->save($pathToWhereToSaveTheManipulatedImage);
bash
php artisan vendor:publish --provider="Spatie\Glide\GlideServiceProvider"