1. Go to this page and download the library: Download g4t/webshot library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
g4t / webshot example snippets
composer
use g4t\WebShot\Screenshot;
$save_path = public_path('files/save.png');
return Screenshot::take('https://google.com')
->size('14-inc')
->saveAs($save_path)
->url();
use g4t\WebShot\Screenshot;
$save_path = public_path('files/save.png');
return Screenshot::take('https://google.com')
->size('14-inc')
->saveAs($save_path)
->path();
use g4t\WebShot\Screenshot;
$save_path = public_path('files/save.png');
return Screenshot::take('https://google.com')
->size('14-inc')
->saveAs($save_path)
->download();