1. Go to this page and download the library: Download jacksleight/laravel-raster 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/ */
jacksleight / laravel-raster example snippets
/* routes/web.php */
use JackSleight\LaravelRaster\Raster;
Route::get('/blog/{post}/hero', function (Post $post) {
return Raster::make('blog.hero')
->data(['post' => $post])
->width(1000);
})->name('blog.hero');
use JackSleight\LaravelRaster\Raster;
Raster::browsershot(fn ($browsershot) => $browsershot
->setOption('args', ['--disable-web-security'])
->waitUntilNetworkIdle()
);