1. Go to this page and download the library: Download josh/laravel-phantomjs 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/ */
// Tells the client to wait for all resources before rendering
$request = \PhantomJs::get('https://www.google.com/');
\PhantomJs::isLazy()->send($request);
// you can use Facade or app make function to use phantomjs
// ex: app('phantomjs') or \PhantomJs
$request = \PhantomJs::get('https://www.google.com/');
$response = \PhantomJs::send($request);
if($response->getStatus() === 200) {
// Dump the requested page content
echo $response->getContent();
}