rdpascua / laravel-identicon
Laravel的Identicon包装器
1.0.0
2017-06-28 18:13 UTC
Requires
- php: >=5.6.4
- illuminate/support: >=4.1 <6.0
- yzalis/identicon: ^1.1
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-09-13 14:47:20 UTC
README
使用identicon生成惊人的头像占位符。
安装
composer require rdpascua/laravel-identicon
将其添加到服务提供者中
Rdpascua\Identicon\IdenticonServiceProvider::class,
并将其添加到外观中
'aliases' => [
'Identicon' => Rdpascua\Identicon\Facades\Identicon::class,
]
用法
Identicon::getImageDataUri($string, $size = 64, $color = null)
返回一个base64图像。
<!-- Base64 URI image --> <img src="{{ Identicon::getImageDataUri('baz') }}"> <!-- Explicitly specify the size and color --> <img src="{{ Identicon::getImageDataUri('foo', 256, 'B4D455') }}">
Identicon::image($string, $size = 64, $color = null)
返回一个包裹在<img>
标签中的base64图像。
<!-- Show image -->
{{ Identicon::image('baz') }}
Identicon::getImageData($string, $size = 64, $color = null)
Identicon::displayImage($string, $size = 64, $color = null)
致谢
许可证
此包装器根据MIT许可证授权