1. Go to this page and download the library: Download flobbos/laravel-image-cache 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/ */
flobbos / laravel-image-cache example snippets
use Flobbos\LaravelImageCache\Facades\ImageCache;
// Example: Apply the "small" template to an image
$cachedImage = ImageCache::template('path/to/image.jpg', 'small');
namespace App\ImageTemplates;
use Intervention\Image\Interfaces\ImageInterface;
class CustomTemplate
{
public function build(ImageInterface $image)
{
$image->resize(800, 600);
}
}
use Flobbos\LaravelImageCache\Facades\ImageCache;
// Example: Apply the "small" template to an image
$cachedImage = ImageCache::template('path/to/image.jpg', 'small');
namespace App\ImageTemplates;
use Intervention\Image\Interfaces\ImageInterface;
class CustomTemplate
{
public function build(ImageInterface $image)
{
$image->resize(800, 600);
}
}
use Flobbos\LaravelImageCache\Facades\ImageCache;
// Example: Apply the "small" template to an image
$cachedImage = ImageCache::template('path/to/image.jpg', 'small');
namespace App\ImageTemplates;
use Intervention\Image\Interfaces\ImageInterface;
class CustomTemplate
{
public function build(ImageInterface $image)
{
$image->resize(800, 600);
}
}