1 | <?php |
||
5 | trait Collections |
||
6 | { |
||
7 | /** |
||
8 | * List collections |
||
9 | * Get a single page from the list of all collections. |
||
10 | * @link https://unsplash.com/documentation#list-collections |
||
11 | * |
||
12 | * @return MarkSitko\LaravelUnsplash\Endpoints\Collections |
||
13 | */ |
||
14 | public function collectionsList() |
||
21 | |||
22 | /** |
||
23 | * List featured collections |
||
24 | * Get a single page from the list of featured collections. |
||
25 | * @link https://unsplash.com/documentation#list-featured-collections |
||
26 | * |
||
27 | * @return MarkSitko\LaravelUnsplash\Endpoints\Collections |
||
28 | */ |
||
29 | public function featuredCollection() |
||
36 | |||
37 | /** |
||
38 | * Get a collection |
||
39 | * Retrieve a single collection. To view a user’s private collections, the read_collections scope is required. |
||
40 | * @link https://unsplash.com/documentation#get-a-collection |
||
41 | * |
||
42 | * @param int|string $id The collections’s ID. Required. |
||
43 | * @return MarkSitko\LaravelUnsplash\Endpoints\Collections |
||
44 | */ |
||
45 | public function showCollection( $id ) |
||
52 | |||
53 | /** |
||
54 | * Get a collection’s photos |
||
55 | * Retrieve a collection’s photos. |
||
56 | * @link https://unsplash.com/documentation#get-a-collections-photos |
||
57 | * |
||
58 | * @param int|string $id The collections’s ID. Required. |
||
59 | * @return MarkSitko\LaravelUnsplash\Endpoints\Collections |
||
60 | */ |
||
61 | public function showCollectionPhotos( $id ) |
||
68 | |||
69 | /** |
||
70 | * List a collection’s related collections |
||
71 | * Retrieve a list of collections related to this one. |
||
72 | * @link https://unsplash.com/documentation#list-a-collections-related-collections |
||
73 | * |
||
74 | * @param int|string $id The collections’s ID. Required. |
||
75 | * @return MarkSitko\LaravelUnsplash\Endpoints\Collections |
||
76 | */ |
||
77 | public function showCollectionRelatedCollections( $id ) |
||
84 | |||
85 | } |
||
86 |
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: