sfneal / view-export
从Laravel应用程序导出视图到PDF或Excel文件
2.10.2
2021-07-08 17:02 UTC
Requires
- php: >=7.4
- dompdf/dompdf: >=1.0
- laravel/framework: >=7
- maatwebsite/excel: >=3.1
- sfneal/aws-s3-helpers: ^1.0
- sfneal/laravel-helpers: >=1.0.3
- sfneal/queueables: ^2.0
- sfneal/string-helpers: >=1.1
- sfneal/view-models: ^3.0
Requires (Dev)
- orchestra/testbench: >=3.8.0
- phpunit/phpunit: >=6.5.14
- scrutinizer/ocular: ^1.8
- dev-master
- 2.10.2
- 2.10.1
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.2.0
- 1.1.0
- 1.0.0
- 0.11.1
- 0.11.0
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.5
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.2
- 0.1.1
- 0.1.0
- dev-dev
This package is auto-updated.
Last update: 2024-09-09 00:26:20 UTC
README
从Laravel应用程序导出视图到PDF或Excel文件。
安装
您可以通过composer安装此包
composer require sfneal/view-export
要修改view-export配置文件,请发布ServiceProvider。
php artisan vendor:publish --provider="Sfneal\ViewExport\Providers\ViewExportServiceProvider"
使用方法
PDF文件
从'视图'导出PDF。
use Sfneal\ViewExport\Pdf\PdfExportService; // Set the view & upload path $view = view('your.view', ['example_data' => ['a'=> 2001, 'b' => 3012]]); $s3Key = 'path/to/save/your/file/example.pdf'; // Initialize an Exporter instance $exporter = PdfExportService::fromView($view)->handle(); // Upload the PDF $exporter->upload($s3Key); // Download in browser $exporter->download(); // Retrieve the upload path $path = $exporter->path();
Excel文件
从'视图'导出Excel文件。
use Sfneal\ViewExport\Excel\ExcelExportService; // Set the view & upload path $view = view('your.view', ['example_data' => ['a'=> 2001, 'b' => 3012]]); $s3Key = 'path/to/save/your/file/example.pdf'; // Initialize an Exporter instance $exporter = ExcelExportService::fromView($view)->handle(); // Upload the PDF $exporter->upload($s3Key); // Download in browser $exporter->download(); // Retrieve the upload path $path = $exporter->path();
测试
composer test
变更日志
请参阅CHANGELOG以获取更多最近更改的信息。
贡献
请参阅CONTRIBUTING以获取详细信息。
安全
如果您发现任何与安全相关的问题,请通过stephen.neal14@gmail.com发送电子邮件,而不是使用问题跟踪器。
致谢
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。
PHP包模板
此包是用PHP包模板生成的。