Download the PHP package aryehraber/statamic-splash without Composer

On this page you can find all versions of the php package aryehraber/statamic-splash. 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 statamic-splash

Splash

Browse Unsplash images right from the CP.

Installation

Install the addon via composer:

Publish the fieldtype assets & config file:

Once installed, you will need to add an Unsplash API Access Key to config/splash.php.

You can register for a free account via the Unsplash Developers page. Next, simply create a "New Application" and use the Demo Access Key, which allows 50 requests/hour, or go through the approval process to increase to 5000 requests/hour (this is still free but takes a little more effort). Note: "requests" only refers to search queries in the CP, once an image has been selected you will be referencing the CDN link which doesn't go through the API.

Usage

Simply add a field inside your blueprint and use type: splash to get started.

Blueprint

After selecting an image and saving your content, the Unsplash response data will be accessible in templates using Antlers (API Guidelines).

The benefit here is that it takes a significant load off your server, since images are often the heaviest assets on a page. Additionally, since Unsplash's CDN is spread worldwide, images will load super fast regardless of the visitor's location.

Tags

Raw

{{ splash:raw :image="field_name" }}

This tag outputs the CDN link to the image's raw URL. Due to the high-quality nature of Unsplash photos, images are often 10-20MB, which is overkill for most websites; you can therefore use a few Glide-like parameters to request exactly what you need (more info below).

Example


Image

{{ splash:image :image="field_name" }} or {{ splash:field_name }}

This tag also outputs the CDN link to the image's raw URL, but includes a few sensible defaults to reduce the image filesize a whole lot.

Any of these params can be overriden by using the parameters listed below, the defaults used are:

Example

Or using the shorthand:


Attribution

{{ splash:attribution :image="field_name" }}

This tag outputs the Unsplash attribution text from their API Guidelines, including links to the photographer's profile and Unsplash website.

Example

Output

Since the photo's meta data is stored inside your content, you can also loop over the photographer's data using Antlers:


Photo Data

By default, only the required photo data is saved from the Unsplash response data for this addon to work. You may specify additional keys using dot notation in the data_saved config option inside config/splash.php.

Example

Alternatively, if you would like to save ALL photo data, you may use the all option instead.


Parameters

Splash offers a number of Glide-like parameters to transform images to your needs. You can pass any Unsplash parameter into the raw and image tags to get started. Just like when using Glide within Statamic, you can also use the easier-to-read alias parameters below:

Param Description
width Sets the width (in pixels).
height Sets the height (in pixels).
square Shortcut to set width and height to the same value.
quality Sets the compression quality (value between 0 and 100).
format Encodes the image to a specific format (recommended to use auto="format" instead to auto-pick based on visitor's browser).
dpr Adjusts the device pixel ratio of the image.
fit Changes the fit of the image within the specified dimensions (see all available values on Imgix).
crop Applies cropping to the image (see all available values on Imgix).
auto Automates a baseline level of optimization for the image (see all available values on Imgix).

All versions of statamic-splash with dependencies

PHP Build Version
Package Version
Requires statamic/cms Version ^4.0 || ^5.0
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 aryehraber/statamic-splash contains the following files

Loading the files please wait ....