for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace MarkSitko\LaravelUnsplash\Endpoints;
trait Photos
{
/**
* List photos
* Get a single page from the list of all photos.
* @link https://unsplash.com/documentation#list-photos
*
* @return MarkSitko\LaravelUnsplash\Endpoints\Photos
*/
public function photos()
$this->apiCall = [
apiCall
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
'endpoint' => 'photos',
];
return $this;
}
* Get a photo
* Retrieve a single photo.
* @link https://unsplash.com/documentation#get-a-photo
* @param string $id
public function photo( $id )
'endpoint' => "photos/{$id}",
* Get a random photo
* @link https://unsplash.com/documentation#get-a-random-photo
public function randomPhoto()
'endpoint' => 'photos/random',
* Get a photo’s statistics
* @link https://unsplash.com/documentation#get-a-photos-statistics
public function photosStatistics($id)
'endpoint' => "photos/{$id}/statistics",
* Track a photo download
* @link https://unsplash.com/documentation#track-a-photo-download
public function trackPhotoDownload($id)
'endpoint' => "photos/{$id}/download"
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: