geofftech/laravel-imagestyle is a Laravel package.
It currently has 0 GitHub stars and 315 downloads on Packagist (latest version 2.3.2).
Install it with composer require geofftech/laravel-imagestyle.
Discover more Laravel packages by geofftech
or browse all Laravel packages to compare alternatives.
Last updated
This Laravel package provides image resizing and caching functionality. When working with this codebase:
img() helper function for easy accessUse the img() helper function to generate image style URLs:
// Basic usage
img($imagePath)->thumbnail()
img($imagePath)->resize(300, 200)
// In Eloquent models
public function thumbnailUrl(): Attribute
{
return Attribute::make(
get: fn () => img($this->image)->thumbnail()
);
}
config/imagestyle.phpconfig/filesystems.php/storage/app/cache and served from /cache URL public function thumbnailUrl(): Attribute
{
return Attribute::make(
get: fn () => img($this->image)->thumbnail()
);
}
/config/filesystem.php 'disks' => [
...
'cache' => [
'driver' => 'local',
'root' => storage_path('app/cache'),
'url' => env('APP_URL') . '/cache',
'visibility' => 'public',
'throw' => false,
],
],
'links' => [
public_path('storage') => storage_path('app/public'),
public_path('cache') => storage_path('app/cache'),
],
a storage:link
/storage/app/cache folder are accessible from the /cache folder in the domain name