PrettyProfile
class PrettyProfile
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.companimal.net/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
in
Singleton at line 12
protected
__construct()
Protected class constructor to prevent direct object creation.
in
Singleton at line 19
final protected void
__clone()
Prevent object cloning
in
Singleton at line 26
void
__wakeup()
Singletons should not be restorable from strings.
in
Singleton at line 37
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.
at line 80
string
nickname(int $id)
Get a nickname to related dogs and cats.
at line 127
string
cat(int $id, string|null $size = null)
Retrieve a cat image URL in various sizes.
at line 141
array
cats(string|null $size = null)
Retrieve all cat images URL in various sizes.
at line 159
string
dog(int $id, string|null $size = null)
Retrieve a dog image URL in various sizes.
at line 173
array
dogs(string|null $size = null)
Retrieve all dog images URLs in various sizes.
at line 192
static string
profileImage(int $id, string|null $image = null, string $animal = 'dog')
This can be used in Laravel Blade.
at line 212
static string
backgroundImage(string|null $background_image = null)
Retrieve a background image URL.