Reputation: 1967
Im trying to set up browsershot in laravel 5.4 to take a screenshot of a web page. I followed the instructions here: https://github.com/spatie/browsershot
So first i ran commands:
npm install puppeteer
composer require spatie/browsershot
And then in my code:
use Spatie\Browsershot\Browsershot;
dd(Browsershot::url('https://example.com')->screenshot());
But this just returns a empty string. Because there is no further feedback i dont know what else to try.
My setup is windows 10, php 7.2.2, node v8.9.4 and npm 5.6.0.
Upvotes: 1
Views: 3190
Reputation: 179
You have to provide the path where to save the screenshot you took, as following example shows:
Browsershot::url('https://example.com')->save($pathToImage);
Upvotes: 3