Download the PHP package exeque/placehold-dot-co without Composer

On this page you can find all versions of the php package exeque/placehold-dot-co. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package placehold-dot-co

Placehold.co

Wrapper for placehold.co to generate placeholder images.

It supports the full API of placehold.co and provides a fluent interface to build the images.

Installation

You can install this package via composer:

Usage

The Image Object

The image object contains the following properties:

The image is stored using a php://temp resource to reduce memory usage. The resource is automatically closed when the object is destroyed.

Basic Usage

Images can be generated using the builder() method.

The Builder class provides an immutable fluent interface to build the image.

Size

By default, the images are created as 300x300, but you can change the size.

It is also possible to change the orientation of the image by using the landscape() and portrait() methods.

Retina

You can also create retina images by using the retina() method.

Only supported for:

Format

You can change the image format by using the format() or format specific methods.

Color

You can change the background and text color by using the color(), background() or foreground() methods.

Note: If you're using the foreground() method without a background color set it will set the background color to white.

The methods support CSS colors, hex colors (without #), and transparency (via the transparent color).

Text

You can change the text by using the text() method. Existing text will be overwritten - Existing text can be removed by using the noText() method.

Multiline text is supported and lines are separated by \n.

Font

You can change the font by using the font() or specific font methods.

Conditional Methods

If you want to use the builder methods conditionally, you can use the when() method.

URL Generation

You can also generate the URL for the image by using the url() method.

Advanced Usage

Batching

The library supports fetching multiple images at once using the batch() method by leveraging the Guzzle library's async requests.

You are not guaranteed to get the images in the same order as you requested them, so you should use the keys to identify the images if order matters.

Caching

The library supports caching the images to optimize performance.

By default, the library uses the php://temp stream to store the images. The cache is handled on the internal HTTP client.

You can also create custom stores by implementing the ExeQue\PlaceholdDotCo\Cache\Contracts\ImageStore interface.

FakerPHP Provider

This library also provides a FakerPHP provider to generate placeholder images.

Most, but not all, features are available in the Faker provider.

Check the phpdoc for the ImageProvider class for more information.

Testing

You can run the tests using the following command:

License

This library is open-sourced software licensed under the MIT license.


All versions of placehold-dot-co with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.0
psr/simple-cache Version ^3.0
webmozart/assert Version ^1.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package exeque/placehold-dot-co contains the following files

Loading the files please wait ....