{"id":28927971,"url":"https://github.com/bst27/laravel-image-proxy","last_synced_at":"2026-03-12T17:04:42.468Z","repository":{"id":299271679,"uuid":"1002163208","full_name":"bst27/laravel-image-proxy","owner":"bst27","description":"A Laravel image proxy to cache, minify and manipulate images very easily.","archived":false,"fork":false,"pushed_at":"2025-06-15T19:14:30.000Z","size":59,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-03T15:24:42.341Z","etag":null,"topics":["imageproxy","laravel","laravel-package","minifier"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bst27.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-14T21:14:54.000Z","updated_at":"2025-09-16T20:16:41.000Z","dependencies_parsed_at":"2025-06-15T18:00:32.790Z","dependency_job_id":"bf6d7eaa-5fff-4cec-84d8-f1d6686f5444","html_url":"https://github.com/bst27/laravel-image-proxy","commit_stats":null,"previous_names":["bst27/laravel-image-proxy"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bst27/laravel-image-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bst27%2Flaravel-image-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bst27%2Flaravel-image-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bst27%2Flaravel-image-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bst27%2Flaravel-image-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bst27","download_url":"https://codeload.github.com/bst27/laravel-image-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bst27%2Flaravel-image-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30434108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["imageproxy","laravel","laravel-package","minifier"],"created_at":"2025-06-22T14:11:29.115Z","updated_at":"2026-03-12T17:04:42.445Z","avatar_url":"https://github.com/bst27.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Image Proxy\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/bst27/laravel-image-proxy.svg?style=flat-square)](https://packagist.org/packages/bst27/laravel-image-proxy)\n![Tests](https://github.com/bst27/laravel-image-proxy/workflows/CI/badge.svg)\n[![Total Downloads](https://img.shields.io/packagist/dt/bst27/laravel-image-proxy.svg?style=flat-square)](https://packagist.org/packages/bst27/laravel-image-proxy)\n\nA Laravel image proxy to cache, minify and manipulate images very easily.\n\n## Features\n- Automatic image compression / minification\n- Automatic caching of images on host and client side\n- Flexible storage options (local, S3, SFTP etc.)\n- Optional: image manipulation (resizing etc.)\n- Optional: custom image filename in URL\n- Easily extendable with custom strategies for image manipulation\n\n---\n\n## Installation\n\n```bash\ncomposer require bst27/laravel-image-proxy\n```\n\nPer default [spatie/image-optimizer](https://github.com/spatie/image-optimizer) is used to compress images.\nSo make sure you install the required dependencies as described in their docs.\n\n---\n\n## Usage\n\nUse the global helper function `proxy_image()` to generate a secure image URL:\n\n```php\n\u003cimg src=\"{{ proxy_image('images/example.jpg') }}\" alt=\"Example\"\u003e\n```\n\nThis will automatically minify and cache the image and generate something like this:\n\n```html\n\u003cimg src=\"http://localhost/img/1AXe...S11lg.jpg\" alt=\"Example\"\u003e\n```\n\nYou can also define a strategy and filename for image manipulation:\n\n```php\n\u003cimg src=\"{{ proxy_image('images/example.jpg', 'default', 'cat.jpg') }}\" alt=\"A black cat\"\u003e\n```\n\nThis will use the `default` strategy for image manipulation, keep the given filename\nand generate something like this:\n\n```php\n\u003cimg src=\"http://localhost/img/1AX5...3c1KAw/cat.jpg\" alt=\"A black cat\"\u003e\n```\n\n---\n\n## Manipulation Strategies\n\nTo manipulate images, you can configure different strategies in [config/image-proxy.php](config/image-proxy.php).\nThe [DefaultManipulator](src/Services/ImageManipulator/DefaultManipulator.php) strategy uses\n[spatie/image-optimizer](https://github.com/spatie/image-optimizer) to compress images.\n\n```php\n'manipulation_strategy' =\u003e [\n    'default' =\u003e [\n        'class'  =\u003e \\Bst27\\ImageProxy\\Services\\ImageManipulator\\DefaultManipulator::class,\n        'params' =\u003e [],\n    ],\n],\n```\n\nEach strategy class must implement the [ImageManipulator](src/Contracts/ImageManipulator.php) contract.\nYou can add your own image manipulation strategy easily:\n1. Implement the contract interface\n2. Add your manipulator to the `manipulation_strategy` array of the `image-proxy.php` with a unique strategy key.\n3. Start using it by calling `proxy_image()` with your strategy key.\n\n---\n\n## Endpoints\n\nTwo routes are registered automatically:\n\n- Short URL:  \n  `/img/{token}.{ext}`\n\n- Named URL:  \n  `/img/{token}/{filename}`\n\nURLs to these routes are generated via `proxy_image()` and require a valid encrypted payload token.\nYou can customize them via the config.\n\n---\n\n## Storage\n\n[Flysystem](https://github.com/thephpleague/flysystem) is used to offer flexible storage options. Per default\nthe original images are read from the `local` storage disk. The cached images are stored on the `local` storage disk, too.\nYou can customize the used storage disks using the plugin config or environment settings.\n\n---\n\n## Configuration\n\nCheck [image-proxy.php](config/image-proxy.php) for default config. You can customize\nconfig via environment variables or publish the config file:\n\n```bash\nphp artisan vendor:publish --provider=\"Bst27\\ImageProxy\\ImageProxyServiceProvider\"\n```\n\nThis will create `config/image-proxy.php`.\n\n---\n\n## Tests\n\nTo run tests, you can execute the following command:\n\n```bash\ndocker run --rm -it \\\n  -u \"$(id -u):$(id -g)\" \\\n  -v \"$PWD\":/var/www/html \\\n  -w /var/www/html \\\n  laravelsail/php84-composer:latest \\\n  php vendor/bin/phpunit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbst27%2Flaravel-image-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbst27%2Flaravel-image-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbst27%2Flaravel-image-proxy/lists"}