├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── composer.json ├── phpunit.xml ├── public └── .gitkeep ├── src ├── Ceejayoz │ └── LaravelPhumbor │ │ ├── Facades │ │ └── Phumbor.php │ │ └── LaravelPhumborServiceProvider.php ├── config │ ├── .gitkeep │ └── config.php ├── lang │ └── .gitkeep ├── migrations │ └── .gitkeep └── views │ └── .gitkeep └── tests └── .gitkeep /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | composer.phar 3 | composer.lock 4 | .DS_Store -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.3 5 | - 5.4 6 | - 5.5 7 | 8 | before_script: 9 | - curl -s http://getcomposer.org/installer | php 10 | - php composer.phar install --dev 11 | 12 | script: phpunit -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Chris Sternal-Johnson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Phumbor for Laravel 4 2 | ===================== 3 | 4 | This Laravel package adds support for [the 99designs PHP interface](https://github.com/99designs/phumbor) to the [globocom Thumbor thumbnail service](https://github.com/globocom/thumbor). 5 | 6 | Installation 7 | ------------ 8 | 9 | Simply require the package in your `composer.json` file: 10 | 11 | "ceejayoz/laravel-phumbor": "dev-master" 12 | 13 | Run `composer install` to download the package and have the autoloader updated. 14 | 15 | Once installed, register the service provider with your Laravel application. Update the `providers` section of `app/config/app.php`: 16 | 17 | 'providers' = array( 18 | // existing providers 19 | 'Ceejayoz\LaravelPhumbor\LaravelPhumborServiceProvider', 20 | ); 21 | 22 | and register the facade in the `aliases` section: 23 | 24 | 'aliases' => array( 25 | // existing aliases 26 | 'Phumbor' => 'Ceejayoz\LaravelPhumbor\Facades\Phumbor', 27 | ); 28 | 29 | Now, publish the package's config file: 30 | 31 | php artisan config:publish ceejayoz/laravel-phumbor 32 | 33 | which will publish the default configuration file to `app/config/packages/ceejayoz/laravel-phumbor/config.php`. 34 | 35 | You should modify this file to reflect your Thumbor installation's URL and secret key. 36 | 37 | Usage 38 | ----- 39 | 40 | The `Phumbor` facade exposes the API from [the 99designs PHP interface](https://github.com/99designs/phumbor). 41 | 42 | For example: 43 | 44 | Phumbor::url('http://images.example.com/llamas.jpg') 45 | ->fitIn(640, 480) 46 | ->addFilter('fill', 'green'); 47 | 48 | License 49 | ------- 50 | 51 | Licensed under the MIT license. See 52 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lohiaad/laravel-phumbor", 3 | "description": "Laravel package adding support for the Phumbor PHP library for Thumbor.", 4 | "homepage": "https://github.com/lohiaad/laravel-phumbor", 5 | "license": "MIT", 6 | "keywords": ["laravel", "phumbor", "thumbor"], 7 | "authors": [ 8 | { 9 | "name": "Chris Sternal-Johnson", 10 | "email": "chris@sternal-johnson.com" 11 | } 12 | ], 13 | "require": { 14 | "php": ">=5.3.0", 15 | "illuminate/support": "5.*", 16 | "99designs/phumbor": "^1.2" 17 | }, 18 | "autoload": { 19 | "classmap": [ 20 | "src/migrations" 21 | ], 22 | "psr-0": { 23 | "Ceejayoz\\LaravelPhumbor": "src/" 24 | } 25 | }, 26 | "minimum-stability": "dev" 27 | } 28 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./tests/ 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceejayoz/laravel-phumbor/8933833af420c3191723e0e195d789f4795ffea6/public/.gitkeep -------------------------------------------------------------------------------- /src/Ceejayoz/LaravelPhumbor/Facades/Phumbor.php: -------------------------------------------------------------------------------- 1 | package('ceejayoz/laravel-phumbor'); 23 | } 24 | 25 | /** 26 | * Register the service provider. 27 | * 28 | * @return void 29 | */ 30 | public function register() 31 | { 32 | $this->app['phumbor'] = $this->app->share(function($app) { 33 | return \Thumbor\Url\BuilderFactory::construct(Config::get('laravel-phumbor::server'), Config::get('laravel-phumbor::key')); 34 | }); 35 | } 36 | 37 | /** 38 | * Get the services provided by the provider. 39 | * 40 | * @return array 41 | */ 42 | public function provides() 43 | { 44 | return array(); 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /src/config/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceejayoz/laravel-phumbor/8933833af420c3191723e0e195d789f4795ffea6/src/config/.gitkeep -------------------------------------------------------------------------------- /src/config/config.php: -------------------------------------------------------------------------------- 1 | 'http://example.com:8888', 7 | 8 | // your Thumbor server's secret key 9 | 'key' => 'YOUR KEY', 10 | ); -------------------------------------------------------------------------------- /src/lang/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceejayoz/laravel-phumbor/8933833af420c3191723e0e195d789f4795ffea6/src/lang/.gitkeep -------------------------------------------------------------------------------- /src/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceejayoz/laravel-phumbor/8933833af420c3191723e0e195d789f4795ffea6/src/migrations/.gitkeep -------------------------------------------------------------------------------- /src/views/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceejayoz/laravel-phumbor/8933833af420c3191723e0e195d789f4795ffea6/src/views/.gitkeep -------------------------------------------------------------------------------- /tests/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceejayoz/laravel-phumbor/8933833af420c3191723e0e195d789f4795ffea6/tests/.gitkeep --------------------------------------------------------------------------------