├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── _config.yml ├── composer.json └── src ├── BaseClass.php ├── Facades ├── UnsplashCollectionsFacade.php ├── UnsplashPhotosFacade.php ├── UnsplashSearchFacade.php └── UnsplashUsersFacade.php ├── Providers ├── UnsplashCollectionsServiceProvider.php ├── UnsplashPhotosServiceProvider.php ├── UnsplashSearchServiceProvider.php ├── UnsplashServiceProvider.php └── UnsplashUsersServiceProvider.php ├── UnsplashCollections.php ├── UnsplashPhotos.php ├── UnsplashSearch.php ├── UnsplashUsers.php └── config └── unsplash.php /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendors -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at contactmespg@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | We accept contributions via Pull Requests on [Github](https://github.com/shweshi/Laravel-Unsplash-Wrapper). 6 | 7 | 8 | ## Pull Requests 9 | 10 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - Check the code style with ``$ composer lint`` and fix it with ``$ composer lint-fix``. 11 | 12 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests. 13 | 14 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 15 | 16 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. 17 | 18 | - **Create feature branches** - Don't ask us to pull from your master branch. 19 | 20 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 21 | 22 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 23 | 24 | 25 | ## Running Tests 26 | 27 | ``` bash 28 | $ composer test 29 | ``` 30 | 31 | **Happy coding**! 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Shashi Prakash Gautam 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LaravelUnsplashWrapper 2 | 3 | [![Latest Version on Packagist](https://img.shields.io/packagist/v/shweshi/Laravel-Unsplash-Wrapper.svg?style=flat-square)](https://packagist.org/packages/shweshi/Laravel-Unsplash-Wrapper) 4 | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/shweshi/Laravel-Unsplash-Wrapper/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/shweshi/Laravel-Unsplash-Wrapper/?branch=master) 5 | [![StyleCI](https://styleci.io/repos/121030344/shield?branch=master)](https://styleci.io/repos/121030344) 6 | [![Build Status](https://scrutinizer-ci.com/g/shweshi/Laravel-Unsplash-Wrapper/badges/build.png?b=master)](https://scrutinizer-ci.com/g/shweshi/Laravel-Unsplash-Wrapper/build-status/master) 7 | [![Total Downloads](https://img.shields.io/packagist/dt/shweshi/Laravel-Unsplash-Wrapper.svg?style=flat-square)](https://packagist.org/packages/shweshi/Laravel-Unsplash-Wrapper) 8 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fshweshi%2FLaravel-Unsplash-Wrapper.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fshweshi%2FLaravel-Unsplash-Wrapper?ref=badge_shield) 9 | 10 | **A Laravel wrapper for Unsplash.** 11 | 12 | ## Install 13 | 14 | Via Composer 15 | 16 | ``` bash 17 | $ composer require shweshi/laravel-unsplash-wrapper 18 | ``` 19 | If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php: 20 | 21 | ``` 22 | shweshi\LaravelUnsplashWrapper\Providers\UnsplashServiceProvider::class, 23 | shweshi\LaravelUnsplashWrapper\Providers\UnsplashSearchServiceProvider::class, 24 | shweshi\LaravelUnsplashWrapper\Providers\UnsplashUsersServiceProvider::class, 25 | shweshi\LaravelUnsplashWrapper\Providers\UnsplashPhotosServiceProvider::class, 26 | shweshi\LaravelUnsplashWrapper\Providers\UnsplashCollectionsServiceProvider::class, 27 | ``` 28 | 29 | If you do run the package on Laravel 5.5+, package auto-discovery takes care of the magic of adding the service provider. 30 | 31 | Next under the alias array in config/app.php add 32 | 33 | ``` 34 | 'UnsplashSearch' => shweshi\LaravelUnsplashWrapper\Facades\UnsplashSearchFacade::class, 35 | 'UnsplashUsers' => shweshi\LaravelUnsplashWrapper\Facades\UnsplashUsersFacade::class, 36 | 'UnsplashPhotos' => shweshi\LaravelUnsplashWrapper\Facades\UnsplashPhotosFacade::class, 37 | 'UnsplashCollections' => shweshi\LaravelUnsplashWrapper\Facades\UnsplashCollectionsFacade::class, 38 | ``` 39 | 40 | You must publish the configuration to provide your own service provider stub. 41 | 42 | ``` bash 43 | $ php artisan vendor:publish --provider="shweshi\LaravelUnsplashWrapper\Providers\UnsplashServiceProvider" 44 | ``` 45 | 46 | Update your settings in the generated app/config/unsplash.php configuration file. 47 | ``` 48 | return [ 49 | 'ApplicationID' => 'YOUR APPLICATION ACCES KEY HERE', 50 | ]; 51 | ``` 52 | ## Usage 53 | See documention for params and others at [unsplash docs](https://unsplash.com/documentation) 54 | 55 | List of methods: 56 | 57 | ### Photos 58 | 59 | ``` php 60 | 61 | $photos = UnsplashPhotos::photos([]); // list of all photos 62 | $photo = UnsplashPhotos::single($id, $params); // single photo 63 | $statistic = UnsplashPhotos::statistic($id, $params); // single photo statistics 64 | $downloadUrl = UnsplashPhotos::download($id, $params); // single photo download link 65 | $curatedPhotos = UnsplashPhotos::curated($params); // list of curated photos 66 | $randomPhoto = UnsplashPhotos::random($params); // random photo 67 | ``` 68 | 69 | ### Users 70 | 71 | ``` php 72 | use UnsplashUsers; 73 | 74 | $user = UnsplashUsers::profile($username, $params); // single user 75 | $portfolio = UnsplashUsers::portfolio($username); // single user's portfolio 76 | $photos = UnsplashUsers::photos($username, $params); // single user's photos 77 | $photos = UnsplashUsers::likes($username, $params); // single user's likes 78 | $collections = UnsplashUsers::collections($username, $params); // single user's collections 79 | $statistics = UnsplashUsers::statistics($username, $params); // single user's statistics 80 | ``` 81 | 82 | ### Collections 83 | 84 | ``` php 85 | use UnsplashCollections; 86 | 87 | $collection = UnsplashCollections::collections($params); // list of all collections 88 | $collection = UnsplashCollections::single($id, $params); // single collections 89 | $photos = UnsplashCollections::photos($id, $params); // collection photos 90 | $statistic = UnsplashCollections::statistic($id, $params); // single collections statistics 91 | $collection = UnsplashCollections::curated($params); // list of curated collections 92 | $collection = UnsplashCollections::related($id, $params); // list of related collections 93 | $collection = UnsplashCollections::featured($params); // list of featured collections 94 | ``` 95 | 96 | ### Search 97 | 98 | ``` php 99 | use UnsplashSearch; 100 | 101 | $photos = UnsplashSearch::photo($query, $params); 102 | $collection = UnsplashSearch::collection($query, $params); 103 | $user = UnsplashSearch::user($query, $params); 104 | ``` 105 | 106 | ### Example 107 | 108 | `echo UnsplashPhotos::photos(['page' => 1, 'order_by' => 'oldest']);` 109 | 110 | will get you something like 111 | ```json 112 | ixlib=rb-0.3.5\u0026q=80\u0026fm=jpg\u0026crop=faces\u0026cs=tinysrgb\u0026fit=crop\u0026h=64\u0026w=64\u0026s=4ddd6656ddd74206872f45c033371087","large":"https://images.unsplash.com/profile-1441298310363-3eb4b1feb829? 113 | ..... 114 | ``` 115 | which you will need to format 116 | 117 | ## Contributing 118 | 119 | Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE OF CONDUCT](CODE_OF_CONDUCT.md) for details. 120 | 121 | ## License 122 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fshweshi%2FLaravel-Unsplash-Wrapper.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fshweshi%2FLaravel-Unsplash-Wrapper?ref=badge_large) 123 | 124 | ## Support 125 | Buy Me A Coffee 126 | 127 | ## Happy Coding! 128 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shweshi/laravel-unsplash-wrapper", 3 | "description": "A Laravel wrapper for Unsplash", 4 | "type": "library", 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Shashi Prakash Gautam", 9 | "email": "contactmespg@gmail.com" 10 | } 11 | ], 12 | "require": { 13 | "illuminate/support": "~5.1", 14 | "php" : "~5.6|~7.0", 15 | "guzzlehttp/guzzle": "~6.0" 16 | }, 17 | "autoload": { 18 | "psr-4": { 19 | "shweshi\\LaravelUnsplashWrapper\\": "src/" 20 | } 21 | }, 22 | "extra": { 23 | "laravel": { 24 | "providers": [ 25 | "shweshi\\LaravelUnsplashWrapper\\Providers\\UnsplashServiceProvider", 26 | "shweshi\\LaravelUnsplashWrapper\\Providers\\UnsplashUsersServiceProvider", 27 | "shweshi\\LaravelUnsplashWrapper\\Providers\\UnsplashPhotosServiceProvider", 28 | "shweshi\\LaravelUnsplashWrapper\\Providers\\UnsplashCollectionsServiceProvider", 29 | "shweshi\\LaravelUnsplashWrapper\\Providers\\UnsplashSearchServiceProvider" 30 | ] 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/BaseClass.php: -------------------------------------------------------------------------------- 1 | $this->baseUrl, 33 | ]); 34 | $response = $client->request('GET', $url, [ 35 | 'headers' => [ 36 | 'Authorization' => 'Client-ID '.config('unsplash.ApplicationID'), 37 | ], 38 | 'form_params' => $params, 39 | 'query' => $params, 40 | ]); 41 | 42 | return $response->getBody(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Facades/UnsplashCollectionsFacade.php: -------------------------------------------------------------------------------- 1 | app->bind('UnsplashCollections', function () { 17 | return new \shweshi\LaravelUnsplashWrapper\UnsplashCollections(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Providers/UnsplashPhotosServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind('UnsplashPhotos', function () { 17 | return new \shweshi\LaravelUnsplashWrapper\UnsplashPhotos(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Providers/UnsplashSearchServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind('UnsplashSearch', function () { 17 | return new \shweshi\LaravelUnsplashWrapper\UnsplashSearch(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Providers/UnsplashServiceProvider.php: -------------------------------------------------------------------------------- 1 | publishes([ 17 | __DIR__.'/../config/unsplash.php' => config_path('unsplash.php'), 18 | ]); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Providers/UnsplashUsersServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind('UnsplashUsers', function () { 17 | return new \shweshi\LaravelUnsplashWrapper\UnsplashUsers(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/UnsplashCollections.php: -------------------------------------------------------------------------------- 1 | call('collections', $params); 17 | } 18 | 19 | /** 20 | * Retrieve a single page from the list of featured collections. 21 | * 22 | * @param array $params 23 | * 24 | * @return mixed 25 | */ 26 | public function featured(array $params) 27 | { 28 | return $this->call('collections/featured', $params); 29 | } 30 | 31 | /** 32 | * Retrieve a single page from the list of curated collections. 33 | * 34 | * @param array $params 35 | * 36 | * @return mixed 37 | */ 38 | public function curated(array $params) 39 | { 40 | return $this->call('collections/curated', $params); 41 | } 42 | 43 | /** 44 | * Retrieve a collection using id. 45 | * 46 | * @param string $id 47 | * @param array $params 48 | * 49 | * @return mixed 50 | */ 51 | public function single($id, array $params) 52 | { 53 | return $this->call('collections/'.$id, $params); 54 | } 55 | 56 | /** 57 | * Retrieve a collection’s photos. 58 | * 59 | * @param string $id 60 | * @param array $params 61 | * 62 | * @return mixed 63 | */ 64 | public function photos($id, array $params) 65 | { 66 | return $this->call('collections/'.$id.'photos', $params); 67 | } 68 | 69 | /** 70 | * Retrieve a list of collections related to this one. 71 | * 72 | * @param string $id 73 | * @param array $params 74 | * 75 | * @return mixed 76 | */ 77 | public function related($id, array $params) 78 | { 79 | return $this->call('collections/'.$id.'related', $params); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/UnsplashPhotos.php: -------------------------------------------------------------------------------- 1 | call('photos', $params); 17 | } 18 | 19 | /** 20 | * Retrieve curated list of photos. 21 | * 22 | * @param array $params 23 | * 24 | * @return mixed 25 | */ 26 | public function curated(array $params) 27 | { 28 | return $this->call('photos/curated', $params); 29 | } 30 | 31 | /** 32 | * Retrieve a single photo using id. 33 | * 34 | * @param string $id 35 | * @param array $params 36 | * 37 | * @return mixed 38 | */ 39 | public function single($id, array $params) 40 | { 41 | return $this->call('photos/'.$id, $params); 42 | } 43 | 44 | /** 45 | * Retrieve a random photo. 46 | * 47 | * @param array $params 48 | * 49 | * @return mixed 50 | */ 51 | public function random(array $params) 52 | { 53 | return $this->call('photos/random', $params); 54 | } 55 | 56 | /** 57 | * Retrieve statistics of the photo. 58 | * 59 | * @param string $id 60 | * @param array $params 61 | * 62 | * @return mixed 63 | */ 64 | public function statistics($id, array $params) 65 | { 66 | return $this->call('/photos/'.$id.'/statistics', $params); 67 | } 68 | 69 | /** 70 | * Retrieve download link of the photo. 71 | * 72 | * @param string $id 73 | * @param array $params 74 | * 75 | * @return mixed 76 | */ 77 | public function download($id, array $params) 78 | { 79 | return $this->call('/photos/'.$id.'/download', $params); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/UnsplashSearch.php: -------------------------------------------------------------------------------- 1 | call('search/photos', $params); 20 | } 21 | 22 | /** 23 | * Search for the collections with search query. 24 | * 25 | * @param string $query 26 | * @param array $params 27 | * 28 | * @return mixed 29 | */ 30 | public function collections($query, array $params) 31 | { 32 | $params['query'] = $query; 33 | 34 | return $this->call('search/collections', $params); 35 | } 36 | 37 | /** 38 | * Search for the users with search query. 39 | * 40 | * @param string $query 41 | * @param array $params 42 | * 43 | * @return mixed 44 | */ 45 | public function users($query, array $params) 46 | { 47 | $params['query'] = $query; 48 | 49 | return $this->call('search/users', $params); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/UnsplashUsers.php: -------------------------------------------------------------------------------- 1 | call('users/'.$username, $params); 18 | } 19 | 20 | /** 21 | * Retrieve portfolio url of the user. 22 | * 23 | * @param string $username 24 | * @param array $params 25 | * 26 | * @return mixed 27 | */ 28 | public function portfolio($username, array $params) 29 | { 30 | return $this->call('users/'.$username.'/portfolio', $params); 31 | } 32 | 33 | /** 34 | * Retrieve photos of the user. 35 | * 36 | * @param string $username 37 | * @param array $params 38 | * 39 | * @return mixed 40 | */ 41 | public function photos($username, array $params) 42 | { 43 | return $this->call('users/'.$username.'/photos', $params); 44 | } 45 | 46 | /** 47 | * Retrieve photos liked by the user. 48 | * 49 | * @param string $username 50 | * @param array $params 51 | * 52 | * @return mixed 53 | */ 54 | public function likes($username, array $params) 55 | { 56 | return $this->call('users/'.$username.'/likes', $params); 57 | } 58 | 59 | /** 60 | * Retrieve collections of the user. 61 | * 62 | * @param string $username 63 | * @param array $params 64 | * 65 | * @return mixed 66 | */ 67 | public function collections($username, array $params) 68 | { 69 | return $this->call('users/'.$username.'/collections', $params); 70 | } 71 | 72 | /** 73 | * Retrieve statistics of the user. 74 | * 75 | * @param string $username 76 | * @param array $params 77 | * 78 | * @return mixed 79 | */ 80 | public function statistics($username, array $params) 81 | { 82 | return $this->call('users/'.$username.'/statistics', $params); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/config/unsplash.php: -------------------------------------------------------------------------------- 1 | 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 5 | ]; 6 | --------------------------------------------------------------------------------