定制 cookiemc337/laravel-adorable 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cookiemc337/laravel-adorable

Composer 安装命令:

composer require cookiemc337/laravel-adorable

包简介

Generate an Adorable Avatar for Laravel

README 文档

README

LaravelAdorable is an library to generate nice avatars on Laravel.

Latest Version Downloads Workflow Status Quality Gate Coverage Status

avatar1

Installation

You may use Composer to install this package into your Laravel project:

composer require asbiin/laravel-adorable

You don't need to add this package to your service providers.

Support

This package supports Laravel 8 and newer, and has been tested with php 7.4 and newer versions.

Configuration

You can publish the LaravelAdorable configuration in a file named config/adorable.php. Just run this artisan command:

php artisan vendor:publish --tag="laraveladorable-config"

This package depends on intervention/image. It requires one of the following image libraries:

  • GD Library (>=2.0)
  • or: Imagick PHP extension (>=6.5.7)

You can configure the image library to use in the driver setting of the config/adorable.php file.

Usage

Use LaravelAdorable facade to generate avatar:

use Illuminate\Support\Str;
use LaravelAdorable\Facades\LaravelAdorable;

…

  $size = 200;
  $hash = Str::uuid()->toString();
  $dataUrl = LaravelAdorable::get($size, $hash);
  // $dataUrl: "data:image/png;base64,..."

This generates a base64 data-url content, like data:image/png;base64,….

You can display a data-url in html with:

  <img src="{{ $dataUrl }}" alt="avatar" />

License

Author: Alexis Saettler

Copyright © 2022.

Licensed under the MIT License. View license.

Inspiration

This work is mainly inspired by itsthatguy/avatars-api-middleware (MIT License).

Images resources are Copyright (c) 2014 Adorable IO LLC.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固