Download the PHP package teariot/faker-fillthis without Composer
On this page you can find all versions of the php package teariot/faker-fillthis. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download teariot/faker-fillthis
More information about teariot/faker-fillthis
Files in teariot/faker-fillthis
Package faker-fillthis
Short Description A Laravel Faker provider for generating placeholder images via the fillthis.io service.
License MIT
Homepage https://github.com/TeaRiot/Faker-FillThis
Informations about the package faker-fillthis
FakerFillThis
FakerFillThis is a custom Faker provider for generating placeholder image URLs and downloading images from fillthis.io. This provider conforms to the Laravel Faker interface for imageUrl
, image
, and url
methods.
Installation
Install via Composer:
Usage
Add the provider to your Faker instance:
Generating an Image URL
-
Default Image: Returns the default endpoint.
-
Custom Dimensions: For a 500x500 image.
-
With Random Word: Appends a random word to the text parameter.
- Category-based Image: When specifying a category (e.g., "fashion" or "all"), the library generates a URL with a seed that directly points to an image from that category. Note that in this mode, the width and height parameters are ignored. This approach is implemented for improved performance by avoiding the need to resize images.
Generating a Video URL
When the type is set to "video"
, the URL will include a .mp4
extension for clear identification:
Downloading an Image
Download an image to a specified directory (or system temporary directory by default):
API Reference
-
imageUrl
-
url
- image
Categories
Note: The list of categories is deprecated. To obtain the complete list of categories, call the API at https://fillthis.io/categories.