PrettyProfile
class PrettyProfile (View source)
This class provides beautiful images of dogs and cats.
Please use only singletons.
Traits
Constants
CAT_AVATAR_URL_PREFIX |
URL Prefix for Cat Images. |
CAT_AVATAR_COUNT |
Total count for Cat images
41 |
DOG_AVATAR_URL_PREFIX |
URL Prefix for Dog Images
https://cabinet-pets.palgle.com/avatars/dog/ |
DEFAULT_BACKGROUND_PREFIX |
URL Prefix for a background image. |
DOG_AVATAR_COUNT |
Total count for Dog images
80 |
Properties
static protected | $instances | from Singleton |
Methods
To return new or existing Singleton instance of the class from which it is called.
Get a nickname to related dogs and cats.
Retrieve a cat image URL in various sizes.
Retrieve all cat images URL in various sizes.
Retrieve a dog image URL in various sizes.
Retrieve all dog images URLs in various sizes.
This can be used in Laravel Blade.
Retrieve a background image URL.
Details
protected
__construct()
Protected class constructor to prevent direct object creation.
final protected void
__clone()
Prevent object cloning
void
__wakeup()
Singletons should not be restorable from strings.
final static Singleton
getInstance()
To return new or existing Singleton instance of the class from which it is called.
As it sets to final it can't be overridden.
string
nickname(int $id)
Get a nickname to related dogs and cats.
string
cat(int $id, string|null $size = null)
Retrieve a cat image URL in various sizes.
array
cats(string|null $size = null)
Retrieve all cat images URL in various sizes.
string
dog(int $id, string|null $size = null)
Retrieve a dog image URL in various sizes.
array
dogs(string|null $size = null)
Retrieve all dog images URLs in various sizes.
static string
profileImage(int $id, string|null $image = null, string $animal = 'dog')
This can be used in Laravel Blade.
static string
backgroundImage(string|null $background_image = null)
Retrieve a background image URL.