\App\TestsUnsplashImageFakerProvider

Faker provider that provides Unsplash images

Summary

Methods
Properties
Constants
unsplashId()
unsplashUrl()
unsplashImage()
No public properties found
No constants found
fetchIds()
getHttpClient()
$ids
$httpClient
N/A
No private methods found
No private properties found
N/A

Properties

$ids

$ids : array|null

Array of possible image IDs

Type

array|null

$httpClient

$httpClient : \GuzzleHttp\Client

Type

\GuzzleHttp\Client

Methods

unsplashId()

unsplashId() : integer

Returns a random Unsplash image id

Returns

integer

unsplashUrl()

unsplashUrl(integer  $width, integer  $height, integer|null  $id = null) : string

Creates an Unsplash image URL

Parameters

integer $width
integer $height
integer|null $id

Random if null

Returns

string

unsplashImage()

unsplashImage(integer  $width, integer  $height, integer|null  $id = null, string  $dir = null) : string

Downloads an Unsplash image. Returns the path to file.

Parameters

integer $width
integer $height
integer|null $id

Random if null

string $dir

Returns

string

fetchIds()

fetchIds() : array

Downloads an array of possible image IDs

Returns

array

getHttpClient()

getHttpClient() : \GuzzleHttp\Client

Returns

\GuzzleHttp\Client