I'm trying to use browsershot (I'm using WAMP to host my local server) and basically I just try to create an instance of the class Browsershot() and it gives me this error :
Class 'Spatie\Browsershot\Browsershot' not found in C:\wamp64\www\html\index.php
I've tried redownloading both node and browsershot but nothing worked, I'm stuck. (I have a node 10 version and a PHP 7)
<?php
use Spatie\Browsershot\Browsershot;
$browser = new Browsershot();
?>
Assuming you have the following directory structure:
+ YourApp
+ vendor
+ composer
+ guzzle
+ intervention
+ ...
- autoload.php
- composer.json
- composer.lock
- index.php
Use following in index.php:
<?php
use Spatie\Browsershot\Browsershot;
require __DIR__ . '/vendor/autoload.php';
$browser = new Browsershot();