https://github.com/bepsvpt/blurhash
A PHP implementation of BlurHash with Laravel integration.
https://github.com/bepsvpt/blurhash
blurhash laravel laravel-package php
Last synced: 11 months ago
JSON representation
A PHP implementation of BlurHash with Laravel integration.
- Host: GitHub
- URL: https://github.com/bepsvpt/blurhash
- Owner: bepsvpt
- License: mit
- Created: 2020-08-03T12:02:02.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-16T03:33:13.000Z (about 1 year ago)
- Last Synced: 2025-04-08T13:14:04.807Z (12 months ago)
- Topics: blurhash, laravel, laravel-package, php
- Language: PHP
- Homepage:
- Size: 3.66 MB
- Stars: 121
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# BlurHash
[](https://github.com/bepsvpt/blurhash/actions/workflows/testing.yml)
[](https://packagist.org/packages/bepsvpt/blurhash)
[](https://packagist.org/packages/bepsvpt/blurhash)
[](https://packagist.org/packages/bepsvpt/blurhash)
A PHP implementation of [BlurHash](https://github.com/woltapp/blurhash) with Laravel integration.
BlurHash is a compact representation of a placeholder for an image.

Nr8%YLkDR4j[aej]NSaznzjuk9ayR3jYofayj[f6
- [Version](#version)
- [Installation](#installation)
- [Usage](#usage)
- [Changelog](#changelog)
- [Upgrade](#upgrade)
- [License](#license)
## Version
4.0.0
### Supported Laravel Version
8.0 ~ 12.x
## Installation
Install using composer
```shell
composer require bepsvpt/blurhash
```
Publish config file
```shell
php artisan vendor:publish --provider="Bepsvpt\Blurhash\BlurHashServiceProvider"
```
Set up config file on config/blurhash.php
Done!
## Usage
### Facade
```php
BlurHash::encode($path);
```
`$file` can be `UploadedFile` or a file path string.
### app helper function
```php
app('blurhash')
->setComponentX(7)
->setComponentY(4)
->setMaxSize(96)
->encode(request('file'));
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for details.
## Upgrade
Please see [UPGRADE](UPGRADE.md) for details.
## License
BlurHash is licensed under [The MIT License (MIT).](LICENSE.md)