barryvdh/laravel-snappy — dự án mã nguồn mở — đang có 2.8k sao GitHub. Laravel Snappy PDF
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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');
}
}
barryvdh/laravel-snappy có 2.8k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/barryvdh/laravel-snappy. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
barryvdh/laravel-snappy có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho barryvdh/laravel-snappy. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
barryvdh/laravel-snappy còn đang phát triển không?
Commit gần nhất trên barryvdh/laravel-snappy là 3 tháng trước (theo timestamp GitHub). Repo có 280 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
barryvdh/laravel-snappy là gì?
barryvdh/laravel-snappy (barryvdh/laravel-snappy) là dự án PHP trên GitHub. Theo mô tả gốc: Laravel Snappy PDF
barryvdh/laravel-snappy viết bằng ngôn ngữ gì?
barryvdh/laravel-snappy chủ yếu viết bằng PHP. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
laravel-snappy có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về laravel-snappy.