diff --git a/README.md b/README.md index 45b162f..2ae2756 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,18 @@ Take website's screenshots with PHP/PhantomJS and save them to PNG, JPG or PDF composer require hotrush/webshotter ``` +## Laravel installation + +After installing package via composer add a service provider to your config/app.php +``` +// app/config/app.php + +'providers' => [ + ..., + hotrush\Webshotter\WebshotServiceProvider::class +]; +``` + ## Usage ``` diff --git a/composer.json b/composer.json index 6b27a07..665a5a0 100644 --- a/composer.json +++ b/composer.json @@ -2,9 +2,10 @@ "name": "hotrush/webshotter", "description": "Make screnshots of webpages with phantomjs", "homepage": "https://github.com/hotrush/webshotter", - "keywords": ["image", "gd", "imagick", "phantomjs", "laravel", "screenshot", "webshot", "webpage", "png", "pdf", "jpg"], + "keywords": ["image", "gd", "imagick", "phantomjs", "laravel", "lumen", "screenshot", "webshot", "webpage", "png", "pdf", "jpg"], "require": { - "php": ">=5.4.0" + "php": ">=5.4.0", + "illuminate/support": "4.*|5.*" }, "require-dev": { "phpunit/phpunit": "^4.8" @@ -21,5 +22,8 @@ "hotrush\\Webshotter\\": "src/hotrush/Webshotter" } }, + "bin": [ + "bin/phantomjs" + ], "minimum-stability": "stable" } diff --git a/src/hotrush/Webshotter/WebshotServiceProvider.php b/src/hotrush/Webshotter/WebshotServiceProvider.php new file mode 100644 index 0000000..cfbb5b1 --- /dev/null +++ b/src/hotrush/Webshotter/WebshotServiceProvider.php @@ -0,0 +1,15 @@ +<?php +namespace hotrush\Webshotter; + +use Illuminate\Support\ServiceProvider; + +class WebshotServiceProvider extends ServiceProvider +{ + public function register() + { + $this->app->bind( + 'webshot', + 'hotrush\Webshot' + ); + } +}