cable8mm/view-transformer
最新稳定版本:v3.0.0
Composer 安装命令:
composer require cable8mm/view-transformer
包简介
View Transformer make profile image or name if client's information is empty.
README 文档
README
This API allows you to freely use names and images of dogs and cats without any limits. These images are hosted on GitHub Pages with the domain cabinet-pets.palgle.com. Additionally, WordPress contents can be converted to HTML, including YouTube embed tags.
This repository is licensed under the MIT license, and the artworks are licensed under the CC BY-NC-ND 4.0 license. For more information, visit: https://github.com/cable8mm/cabinet-pets.
We have provided the API Documentation on the web. For more information, please visit https://palgle.com/view-transformer/ ❤️
Features
- 4,080 names for a dog or a cat without any limits
- 81 images for a dog under CC BY-NC-ND 4.0 license
- 40 images for a cat under CC BY-NC-ND 4.0 license
Preview
Dog artworks
Cat artworks
Installation
composer require cable8mm/view-transformer
Usage
APIs
The number 393939 would be better utilized as a user ID.
use Cable8mm\ViewTransformer\PrettyProfile; PrettyProfile::getInstance()->nickname(393939) // get a nickname. print PrettyProfile::getInstance()->cat(393939); print PrettyProfile::getInstance()->cat(393939, 'large'); // The second argument can be 'large', 'medium', or 'small'. Null indicates the original size. print PrettyProfile::getInstance()->dog(393939); print PrettyProfile::getInstance()->dog(393939, 'large'); print PrettyProfile::getInstance()->cats(); // All cat images print PrettyProfile::getInstance()->cats('medium'); // All cat images in medium size print PrettyProfile::getInstance()->dogs(); print PrettyProfile::getInstance()->dogs('medium');
Various cases
It has been designed to retrieve an image by user ID, even if the ID is a large number.
use Cable8mm\ViewTransformer\PrettyProfile; print PrettyProfile::getInstance()->nickname(1) //=> 평범한 네벨룽;
use Cable8mm\ViewTransformer\PrettyProfile; print PrettyProfile::getInstance()->cat(1); //=> https://cabinet-pets.palgle.com/avatars/cat/1.png;
You can use it as follows in Laravel Blade:
{{ PrettyProfileHelper::profileImage(4123, animal:'dog') }} {{-- ==> https://cabinet-pets.palgle.com/avatars/dog/43.png --}}
Preview can be generated using the following code:
use Cable8mm\ViewTransformer\PrettyProfile; $dogs = PrettyProfile::getInstance()->dogs('medium'); array_map( fn($item, $key) => print ''.PHP_EOL, $dogs, array_keys($dogs) ); //=> ... $cats = PrettyProfile::getInstance()->cats('medium'); array_map( fn($item, $key) => print ''.PHP_EOL, $cats, array_keys($cats) ); //=> ...
Formatting
composer lint # Modify all files to comply with the PSR-12. composer inspect # Inspect all files to ensure compliance with PSR-12.
Test
composer test
License
The View Transformer project is open-sourced software licensed under the MIT license.
Artworks © 2020 by Samgu Lee is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-11