public static function random($filters = [])
    {
        if (isset($filters['category']) && is_array($filters['category'])) {
            $filters['category'] = implode(',', $filters['category']);
        }

        $filters['featured'] = (isset($filters['featured']) && $filters['featured']) ? 'true' : null;

        $photo = json_decode(self::get("photos/random", ['query' => $filters])->getBody(), true);

        return new self($photo);
    }
public static function random($filters = [])
    {
        if (isset($filters['category']) && is_array($filters['category'])) {
            $filters['category'] = implode(',', $filters['category']);
        }

        $filters['featured'] = (isset($filters['featured']) && $filters['featured']) ? 'true' : null;

        $photo = json_decode(self::get("photos/random", ['query' => $filters])->getBody(), true);

        return new self($photo);
    }
public static function random ( $ filters = [ ] ) { if ( isset ( $ filters [ 'category' ] ) && is_array ( $ filters [ 'category' ] ) ) { $ filters [ 'category' ] = implode ( ',' , $ filters [ 'category' ] ) ; } $ filters [ 'featured' ] = ( isset ( $ filters [ 'featured' ] ) && $ filters [ 'featured' ] ) ? 'true' : null ; $ photo = json_decode ( self :: get ( "photos/random" , [ 'query' => $ filters ] ) -> getBody ( ) , true ) ; return new self ( $ photo ) ; }
Retrieve a single random photo, given optional filters.

@param $filters array Apply optional filters.
@return Photo
Retrieve a single random photo given optional filters .