https://github.com/cable8mm/view-transformer
View Transformer make profile image or name if client's information is empty.
https://github.com/cable8mm/view-transformer
api avatar cats dogs image php
Last synced: about 1 month ago
JSON representation
View Transformer make profile image or name if client's information is empty.
- Host: GitHub
- URL: https://github.com/cable8mm/view-transformer
- Owner: cable8mm
- License: other
- Created: 2020-06-03T08:05:47.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-03-11T11:51:54.000Z (over 1 year ago)
- Last Synced: 2025-03-11T12:16:54.321Z (over 1 year ago)
- Topics: api, avatar, cats, dogs, image, php
- Language: PHP
- Homepage: https://www.palgle.com/view-transformer/
- Size: 175 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# View Transformer
[](https://github.com/cable8mm/view-transformer/actions/workflows/code-style.yml)
[](https://github.com/cable8mm/view-transformer/actions/workflows/run-tests.yml)
[](https://packagist.org/packages/cable8mm/view-transformer)
[](https://packagist.org/packages/cable8mm/view-transformer/stats)
[](https://packagist.org/packages/cable8mm/view-transformer)
[](https://github.com/cable8mm/view-transformer/stargazers)
[](https://creativecommons.org/licenses/by-nc-nd/4.0/)
[](https://github.com/cable8mm/view-transformer/blob/main/LICENSE.md)
This API allows you to freely use names and images of dogs and cats without any limits. These images are hosted on [GitHub Pages](https://github.com/cable8mm/cabinet-pets) 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](https://creativecommons.org/licenses/by-nc-nd/4.0/?ref=chooser-v1). For more information, visit: .
We have provided the API Documentation on the web. For more information, please visit ❤️
## Features
- [x] 4,080 names for a dog or a cat without any limits
- [x] 81 images for a dog under [CC BY-NC-ND 4.0 license](https://creativecommons.org/licenses/by-nc-nd/4.0/?ref=chooser-v1)
- [x] 40 images for a cat under [CC BY-NC-ND 4.0 license](https://creativecommons.org/licenses/by-nc-nd/4.0/?ref=chooser-v1)
## Preview
### Dog artworks
















































































### Cat artworks









































## Installation
```sh
composer require cable8mm/view-transformer
```
## Usage
### APIs
The number 393939 would be better utilized as a user ID.
```php
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.
```php
use Cable8mm\ViewTransformer\PrettyProfile;
print PrettyProfile::getInstance()->nickname(1)
//=> 평범한 네벨룽;
```
```php
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:
```blade
{{ PrettyProfileHelper::profileImage(4123, animal:'dog') }}
{{-- ==> https://cabinet-pets.palgle.com/avatars/dog/43.png --}}
```
Preview can be generated using the following code:
```php
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
```bash
composer lint
# Modify all files to comply with the PSR-12.
composer inspect
# Inspect all files to ensure compliance with PSR-12.
```
## Test
```sh
composer test
```
## License
The View Transformer project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
[Artworks](https://github.com/cable8mm/cabinet-pets) © 2020 by [Samgu Lee](https://github.com/cable8mm) is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit