As an open-source project, barryvdh/laravel-snappy has picked up 2.8k stars on GitHub (PHP). Laravel Snappy PDF
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Require this package in your composer.json and update composer.
composer require barryvdh/laravel-snappy
Laravel
Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider/Facade. If you also use laravel-dompdf, watch out for conflicts. It could be better to manually register the Facade.
After updating composer, add the ServiceProvider to the providers array in config/app.php
Barryvdh\Snappy\ServiceProvider::class,
Optionally you can use the Facade for shorter code. Add this to your facades:
To customise the configuration file, copy the file /vendor/barryvdh/laravel-snappy/config/snappy.php to the /config folder.
Usage
You can create a new Snappy PDF/Image instance and load a HTML string, file or view name. You can save it to a file, or inline (show in browser) or download.
If you need the output as a string, you can get the rendered PDF with the output() function, so you can save/output it yourself.
See the wkhtmltopdf manual for more information/settings.
Testing - PDF fake
As an alternative to mocking, you may use the PDF facade's fake method. When using fakes, assertions are made after the code under test is executed:
<?php
namespace Tests\Feature;
use Tests\TestCase;
use PDF;
class ExampleTest extends TestCase
{
public function testPrintOrderShipping()
{
PDF::fake();
// Perform order shipping...
PDF::assertViewIs('view-pdf-order-shipping');
PDF::assertSee('Name');
}
}
TopGit's last sync did not record any GitHub topics for barryvdh/laravel-snappy. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on barryvdh/laravel-snappy?
The most recent commit recorded on barryvdh/laravel-snappy was 4 months ago, based on the GitHub push timestamp. The repository has 281 forks — one of the better signals of community interest.
How many stars does barryvdh/laravel-snappy have?
barryvdh/laravel-snappy has 2.8k GitHub stars — refresh the page for the live number, or check github.com/barryvdh/laravel-snappy. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What is barryvdh/laravel-snappy?
barryvdh/laravel-snappy (barryvdh/laravel-snappy) is a PHP project on GitHub. From the project's own README: Laravel Snappy PDF
What language is barryvdh/laravel-snappy written in?
barryvdh/laravel-snappy is written primarily in PHP. GitHub's language field is based on the largest share of bytes in the default branch.
Read full README in the tab above.
Still deciding about laravel-snappy?
One click hands the question to an AI along with this page — see what it says about laravel-snappy.